我在 main.go 中从非主包运行函数时遇到问题
// main.go
package main
import test "./tests"
func main() {
test.Test("hello world")
}
// (relative to main.go) ./tests/test.go
package test
import "fmt"
func Test(str string) {
fmt.Println(str)
}
输出:build command-line-arguments: cannot find module for path _/c_/Users/Mike/Desktop/random/tests
不负相思意
相关分类