title: Golang: Installation directory error?
body: <p>I have the error:</p>
  
  <pre><code>go install: no install location for directory /Users/xwilly/Dropbox/go/project/src outside GOPATH 
  </code></pre>
  
  <p>I'm using go version 1.1 on OS X.</p>
  
  <p>I can build &amp; run but can't install packages.</p>
  
  <p>My environment:</p>
  
  <pre><code>GOPATH=/Users/xwilly/Dropbox/go/project
  PATH=/Library/Frameworks/Python.framework/Versions/2.7/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/go/bin:/Users/xwilly/Dropbox/go/project/bin
  </code></pre>
  
  <p>Project tree:</p>
  
  <pre><code>/Users/xwilly/Dropbox/go/project
  bin
  pkg
  src
  </code></pre>
  
  <p>I can build without error:</p>
  
  <pre><code>..:src xwilly$ go build test.go 
  ..:src xwilly$ go install test.go
  go install: no install location for directory /Users/xwilly/Dropbox/go/project/src outside GOPATH
  </code></pre>
  
  <p>Here is a simple example:</p>
  
  <pre><code>xwilly$ cat test.go 
  package main
  
  import (
      "fmt"
  )
  
  func main() {
      fmt.Println("Bonjour")
  }
  xwilly$ go run test.go 
  Bonjour
  xwilly$ go install test.go 
  go install: no install location for directory /Users/xwilly/Dropbox/go/project/src/learning outside GOPATH
  </code></pre>