14

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?

Wyatt
  • 1,357
  • 5
  • 17
  • 26

1 Answers1

22

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.
freeformz
  • 847
  • 8
  • 12