You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I ran into an issue when using go-imports-add that the 'go' command was not found. This is because in my case I use direnv to setup the environment on a per-project basis, so when the subshell is launched to run the go-command it will not find it in the global path.
The solution was to add the following to my config, as they covered all cases of go-command being called in go-mode.el
(use-package! inheritenv
:config
;; ensure that the environment is carried over to the subshell that is called.
;; this was tested against go-mode specifically go-import-add
(inheritenv-add-advice #'process-lines)
(inheritenv-add-advice #'shell-command-to-string))
https://github.com/purcell/inheritenv suggests that this could also be set within the library. I know that you are doing a large rewrite at the moment, but I was wondering if it is something that you would consider including in the rewrite? It was not obvious why most of the functionality was working, but these few commands were failing to find the binary in the PATH.
Even without direnv integration, it will still use the main env that the user has running, so it will be a nondestructive change.
The text was updated successfully, but these errors were encountered:
Hi @dominikh. Thanks for all the great work!
I ran into an issue when using go-imports-add that the 'go' command was not found. This is because in my case I use direnv to setup the environment on a per-project basis, so when the subshell is launched to run the go-command it will not find it in the global path.
The solution was to add the following to my config, as they covered all cases of go-command being called in go-mode.el
https://github.com/purcell/inheritenv suggests that this could also be set within the library. I know that you are doing a large rewrite at the moment, but I was wondering if it is something that you would consider including in the rewrite? It was not obvious why most of the functionality was working, but these few commands were failing to find the binary in the PATH.
Even without direnv integration, it will still use the main env that the user has running, so it will be a nondestructive change.
The text was updated successfully, but these errors were encountered: