I install go by snap, the path to executable file of go is not in environment variable path, but when I use
go run test.go
in terminal (from my home directory), go still work.
As my understand, the path to executable file of go must in environment variable path, so linux can find where it is and run it. In this case, how Linux find where executable file of go is?
Here is my path variable (in file /etc/environment)
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games"
And here is path to executable file of go:
/snap/go/3095/bin/
I use linux mint xfce 18.3