我正在尝试编译由多个模块组成的Go程序,如下所示:
// 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
现在,当我在包含和的目录中运行其中一个go run main.go或go build之后export GOPATH=.时,它会打印main.gosrc
# disjsets
open src/disjsets/disjsets.go: No such file or directory
我不明白这一点。文件在那里ls -l src/disjsets/disjsets.go确认。这怎么会发生?disjsets.go如果Go要找到文件,该文件应放在哪里?
(Google Go 1.0.2)
慕村9548890
海绵宝宝撒
相关分类