title: How do I SET the GOPATH environment variable on Ubuntu? What file must I edit?
body: <p>I am trying to do a <code>go get</code>:</p>
  
  <pre><code>go get github.com/go-sql-driver/mysql
  </code></pre>
  
  <p>and it fails with the following error:</p>
  
  <pre><code>package github.com/go-sql-driver/mysql: cannot download, $GOPATH not set. For more details see: go help gopath
  </code></pre>
  
  <p>when I do a <code>go env</code> , a list of Go values is shown as below:</p>
  
  <pre><code>ubuntu@ip-xxx-x-xx-x:~$ go env
  GOARCH="amd64"
  GOBIN=""
  GOCHAR="6"
  GOEXE=""
  GOHOSTARCH="amd64"
  GOHOSTOS="linux"
  GOOS="linux"
  GOPATH=""
  GORACE=""
  GOROOT="/usr/lib/go"
  GOTOOLDIR="/usr/lib/go/pkg/tool/linux_amd64"
  CC="gcc"
  GOGCCFLAGS="-g -O2 -fPIC -m64 -pthread"
  CGO_ENABLED="1"
  </code></pre>
  
  <p>clearly the GOPATH is not set, how and where do I set it?</p>
  
  <p>I see many threads that mention this error but none that provide an answer to my question, which file needs to be edited to provide a value for this path?</p>