Current Behavior
I have two items in the GOPATH variable, which has the benefit, that packages downloaded via go get are placed in the path of the first item and my own packages belong to the second item. You can read more about this here.
You'll see the following when opening the shell.
Last login: Sat Feb 16 20:48:02 on ttys002
Welcome to fish, the friendly interactive shell
[: unexpected argument at index 2: '/Users/danieltrautmann/Development/Projects'
~ β
go env
~ β go env | grep GOPATH
GOPATH="/Users/danieltrautmann/Development/Go:/Users/danieltrautmann/Development/Projects"
Expected Behavior
I'd expect no error message at all.
Relevant Fish Configuration
_~/.config/fish/conf.d/04go.fish
set -gx GOPATH $HOME/Development/Go $HOME/Development/Projects
set -gx GO111MODULE off
_~/.config/fish/conf.d/99prompt.fish
set SPACEFISH_PROMPT_ORDER exit_code kubecontext golang pyenv git dir char
Environment
Spacefish version: 2.2.2
Fish version: 3.0.1
Fish plugin manager: fisher
Terminal emulator: iTerm
Operating system: OSX 10.14.3
Possible Solution
I figured out that [ -n $GOPATH ] in ~/.config/fish/functions/__sf_section_golang.fish is causing this and fixed it by replacing it with [ (count $GOPATH) -gt 0 ].
Now the prompt looks like the following.
~ β cd ~/Development/Go/src/github.com/spf13/cobra/
πΉ v1.11.5 on ξ master in cobra β cd ~/Development/Projects/src/github.com/danieltrautmann/httpstat/
πΉ v1.11.5 on ξ csv-output [!?] in httpstat β
Bug Report
Current Behavior I have two items in the GOPATH variable, which has the benefit, that packages downloaded via
go get
are placed in the path of the first item and my own packages belong to the second item. You can read more about this here.You'll see the following when opening the shell.
go env
variable content
Expected Behavior I'd expect no error message at all.
Relevant
Fish
Configuration_~/.config/fish/conf.d/04go.fish
_~/.config/fish/conf.d/99prompt.fish
Environment
Possible Solution I figured out that
[ -n $GOPATH ]
in~/.config/fish/functions/__sf_section_golang.fish
is causing this and fixed it by replacing it with[ (count $GOPATH) -gt 0 ]
.Now the prompt looks like the following.