为所有用户设置转到路径时出错。

I have installed go and successfully setup it's path. In order to run hello.py I have to run

   sudo go run hello.go 

but I want to run it from

  go run hello.go 

but it doesn't work. I did path setup in .bashrc and .profile do I have to do anything more?

Try to do a manual installation, entirely in your $HOME (that way, root is never involved, and you won't have to do any sudo.

mkdir ~/golang
cd ~/golang
wget https://storage.googleapis.com/golang/go1.3.3.linux-amd64.tar.gz
tar -xzf go1.3.1.linux-amd64.tar.gz

Add the following lines to your ~/.bashrc file:

export GOROOT=$HOME/golang/go 
export PATH=$PATH:$GOROOT/bin
export GOPATH=~/golang/yourProjects

Then

mkdir -p ~/golang/yourProjects/src

And you can start playing with ~/golang/yourProjects/src/hello.go.

See more about go workspace (the folder referenced by $GOPATH) in "How to Write Go Code".