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

时间:2015-06-30 17:00:59

标签: go

我使用go build生成文件。但我只能生成main,这意味着go build main.go有效,而go build dao.go无法生成任何内容?

如何生成dao

1 个答案:

答案 0 :(得分:7)

来自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.