set -x
will only affect your current session. Once you logout of that session, the export will go away.
set --export --global
will export your environment across all running fish sessions, however is ephemeral and will not persist after you log out.
set --export --universal
will export your environment across all running fish sessions, and is persistent.
-g or --global
Causes the specified shell variable to be given a global scope.
Global variables don't disappear and are available to all functions
running in the same shell. They can even be modified.
-U or --universal
Causes the specified shell variable to be given a universal scope.
If this option is supplied, the variable will be shared between all the current
user's fish instances on the current computer, and will be preserved across
restarts of the shell
If you are running a current version of fish, you can use the built in fish_add_path (go env GOPATH)/bin
once and it's done, you don't have to have it in a conf file.
(go env GOPATH)
in the config.fish file... In my config I have the full path:set -x GOPATH /home/myuser/go
– Broiderset -x GOPATH (go env GOPATH)
in my ~/.config/fish/config.fish. I suspect your actual situation is different from what you have reported here. One possibility is you haven't set$PATH
appropriately. – Labradorite