Reputation: 12244
I downloaded go1.7.5.darwin-amd64.tar.gz for osx 10.12.2.
Unpacked the tar and went to the /bin directory to see if the Go executable would run.
$ cd Downloads/go/bin
$ ls
total 54560
-rwxr-xr-x@ 1 bryanwheelock staff 9884220 Feb 10 16:53 go
-rwxr-xr-x@ 1 bryanwheelock staff 15065500 Feb 10 16:53 godoc
-rwxr-xr-x@ 1 bryanwheelock staff 2976976 Feb 10 16:53 gofmt
bryanwheelock@Bryans-MacBook Fri Feb 10 16:57:45 ~/Downloads/go/bin
$ go version
-bash: go: command not found
Upvotes: 0
Views: 2226
Reputation: 310
sudo chmod +x go
seems like it does not have execute permission, so just change permission and run it then you should alias your go binary path to your environment to access binary every where.
Upvotes: -1
Reputation: 7843
When you type a command without giving the full path, your system will try to find it within all the folders provided in $PATH
variable.
In typical Unix environment, your $PATH
does not include "your current folder". So you need to either:
$HOME/Downloads/go/bin/go
); or./go
); or$HOME/Downloads/go/bin
in your $PATH
variable; or.
(Unix way of saying "your current folder") in your $PATH
; orput your go binary into folders that already in your $PATH
. For example
sudo cp $HOME/Downloads/go/bin/* /usr/local/bin/.
Upvotes: 3