Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"go build" does not generate file in golang [duplicate]

Tags:

go

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?

like image 364
Wyatt Avatar asked Jun 30 '15 17:06

Wyatt


1 Answers

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.
like image 90
freeformz Avatar answered Oct 13 '22 03:10

freeformz