show gopath cmd get gopath
use go env
in cmd, and it'll show environment information including gopath.
see https://golang.org/cmd/go/#hdr-Print_Go_environment_information
Besides if you want to set or get environment variable by code,
see here: https://gobyexample.com/environment-variables