title: What does the Go compiler mean by "no such file or directory"?
body: <p>I'm trying to compile a Go program made up of multiple modules, like so:</p>
  
  <pre><code>// main.go
  package main
  import "mst"
  // do something interesting involving minimum spanning trees
  
  // src/mst/kruskal.go
  import "disjsets"
  // Kruskal's algorithm follows
  
  // src/disjsets/disjsets.go
  // implements disjoint sets with union-find
  </code></pre>
  
  <p>Now, when I run either <code>go run main.go</code> or <code>go build</code> after <code>export GOPATH=.</code> in the directory containing both <code>main.go</code> and <code>src</code>, it prints</p>
  
  <pre><code># disjsets
  open src/disjsets/disjsets.go: No such file or directory
  </code></pre>
  
  <p>I don't get this. The file is there as <code>ls -l src/disjsets/disjsets.go</code> confirms. How can this happen? Where should the <code>disjsets.go</code> file live if Go is to find it?</p>
  
  <p>(Google Go 1.0.2)</p>