“ go build”不会在golang中生成文件

This question already has an answer here:

I used go build to generate files. But I can only generate main, which mean go build main.go works while go build dao.go does not generate anything?

How can I generate dao?

</div>

From 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.