I'm trying to compile a Go program made up of multiple modules, like so:
// 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
Now, when I run either go run main.go
or go build
after export GOPATH=.
in the directory containing both main.go
and src
, it prints
# disjsets
open src/disjsets/disjsets.go: No such file or directory
I don't get this. The file is there as ls -l src/disjsets/disjsets.go
confirms. How can this happen? Where should the disjsets.go
file live if Go is to find it?
(Google Go 1.0.2)