Thank you, but I still can't do what I would like. Now I am probably out of the topic, but you helped me so maybe you know the answer to this different question.
I am starting with the go language and to check if installed properly I have to do this:
Create a file named hello.go that looks like:
package main
import "fmt"
func main() {
fmt.Printf("hello, world\n")
}
Then build it with the go tool:
$ go build hello.go
The command above will build an executable named hello in the current directory alongside your source code. Execute it to see the greeting:
$ ./hello
hello, world
I created the file using textedit but after giving the build command in the terminal I had an error message
MacBook-Pro-di-Giorgio:~ giorgio$ go build hello.go
can't load package: package hello.go: cannot find package "hello.go" in any of:
/usr/local/go/src/hello.go (from $GOROOT)
/Users/giorgio/go/src/hello.go (from $GOPATH)
I was thinking I should only place the file in the right folder but it didn't work because I had again the same error message.
I only installed the go package and added in the /etc/profile the line
export PATH=$PATH:/usr/local/go/bin
I added the same line in the $HOME/.profile .
Can you help me?