I have python code as
import sys
sys.path.append("/usr/local/py")
How can I convert this code in go language? how to append the path to system path?
Go creates statically linked binaries when you compile. The closest equivalent would be setting your GOPATH environment variable to search that directory as well. Typically, when you set up your environment you export that variable so go knows where to look for packages. You can append as many directories to that as you like export GOPATH=$GOPATH:/usr/local/bin/go
and it will search those paths for the module.