Hello, I am new to Go and not exactly proficient in other languages, but I can work my way through some issues. I’m hoping this is simple, I just can’t seem to solve it…
I was following the Go Intro codes and came to the Compile and install the application page. I was able to run $ go build my hello.go file and run it as $ ./hello. When I ran the $ export PATH=$PATH:/path/to/your/install/directory and then the $ go install, I was getting
-bash: hello: command not found
My export path was $ export PATH=$PATH:/Users/*ComputerName*/go/bin/hello, and when I $ echo PATH… what a mess that shows.
Could someone help give me an idea of what to try? Thank you,
So following the instructions from, i create the dir “hello” and the file “hello.go”. By my understanding, I am asking it was supposed to point to the directory “hello”… ?
I updated my original post to read a little easier.
Following the instructions from Go, are you suggesting i should run your command instead of their instructions? The link to the instructions is in the original post.
So make sure that the GOBIN is in PATH, the most portable way is how I showed above.
Please remember, that it works only for the current shell, and has to be repeated for each shell you open unless you add an equivalent line to your shells init files.