go初学者提问,同一个目录下,main.go 不能访问其他文件里面的方法

Orocker · · 1758 次点击
```shell go run [build flags] [-exec xprog] package [arguments...] ``` Run compiles and runs the named **main** Go package. Typically the package is specified as **a list of .go source files** from a single directory, but it may also be an import path, file system path, or pattern matching a single known package, as in 'go run .' or 'go run my/cmd'. [go run](https://golang.org/cmd/go/#hdr-Compile_and_run_Go_program)
#9
更多评论
`go run main.go hey.go` 就不会报错
#2