"go build"不会在golang中生成文件

Wya*_*att 7 go

我曾经go build生成过文件.但我只能生成main,这意味着go build main.go工作go build dao.go而不产生任何东西?

我怎么生成dao

fre*_*rmz 6

来自go help build:

When the command line specifies a single main package,
build writes the resulting executable to output.
Otherwise build compiles the packages but discards the results,
serving only as a check that the packages can be built.
Run Code Online (Sandbox Code Playgroud)