title: Using Go 1.2 cover tool with GVM
body: <p>I'm using GVM to manage my go installations and paths and everything seems to work just fine - I can run tests and produce builds. I'm now trying to produce a code coverage file and am having some difficulty.</p>
  
  <p>My package is defined in <code>/home/bill/dev/server/model</code>.</p>
  
  <p>When I run:</p>
  
  <pre><code>$ go test -cover -coverprofile cover.out
  </code></pre>
  
  <p>The tests run successfully and a coverage file is produced. However, the paths in the coverage file look like this:</p>
  
  <p><code>
  _/home/bill/dev/server/model/activity.go:19.34,21.2 1 1
  </code></p>
  
  <p>And I get the following error when I try to create an html cover file:</p>
  
  <pre><code>$ go tool cover -html=cover.out
  
  cover: can't find "activity.go": cannot find package "_/home/bill/dev/server/model/" in any of:
      /home/bill/.gvm/gos/go1.2/src/pkg/_/home/bill/dev/server/model (from $GOROOT)
      /home/bill/.gvm/pkgsets/go1.2/global/src/_/home/bill/dev/server/model (from $GOPATH)
  </code></pre>
  
  <p>How do I fix this?</p>
  
  <p><strong>Additional details</strong></p>
  
  <pre><code>~ gvm use go1.2
  Now using version go1.2
  
  ~ echo $GOPATH
  /home/bill/.gvm/pkgsets/go1.2/global
  
  ~ echo $GOROOT
  /home/bill/.gvm/gos/go1.2
  </code></pre>
  
  <p>I tried manually setting my $GOPATH but that didn't change the cover.out file. I also tried manually editing the cover.out file but I can't figure out what paths it actually wants. In the default configuration shown above, running <code>go test</code> runs as expected.</p>
  
  <p><strong>Attempting to fix GOPATH</strong></p>
  
  <pre><code>~ export GOPATH=/home/bill/dev/
  ~ ln -s /home/bill/dev/server /home/bill/.gvm/gos/go1.2/src
  
  ~ go test
  cannot find package "code.google.com/p/go.crypto/pbkdf2" in any of:
  /home/bill/.gvm/gos/go1.2/src/pkg/code.google.com/p/go.crypto/pbkdf2 (from $GOROOT)
  /home/bill/dev/src/code.google.com/p/go.crypto/pbkdf2 (from $GOPATH)
  ../util/log.go:4:2: cannot find package "github.com/kr/pretty" in any of:
  /home/bill/.gvm/gos/go1.2/src/pkg/github.com/kr/pretty (from $GOROOT)
  /home/bill/dev/src/github.com/kr/pretty (from $GOPATH)
  </code></pre>
  
  <p>These are additional dependencies that I previously downloaded using <code>go get</code>. They end up in /home/bill/.gvm/pkgsets/go1.2/global/src which the $GOPATH used to point to. So I changed GOPATH</p>
  
  <pre><code>~ export GOPATH=/home/bill/dev/:/home/bill/.gvm/pkgsets/go1.2/global
  </code></pre>
  
  <p>So that the tests run again, but the cover.out file still has the same directories in it and still gives me the same error.</p>