title: How to get current GOPATH from code
body: <p>How do I get the current <code>GOPATH</code> from a block of code?</p>
  
  <p><code>runtime</code> only has <code>GOROOT</code>:</p>
  
  <pre><code>// GOROOT returns the root of the Go tree.
  // It uses the GOROOT environment variable, if set,
  // or else the root used during the Go build.
  func GOROOT() string {
      s := gogetenv("GOROOT")
      if s != "" {
          return s
      }
      return defaultGoroot
  }
  </code></pre>
  
  <p>I could make a function that has <code>GOROOT</code> replaced with <code>GOPATH</code>, but is there a buildin for this?</p>