/ go Public
cmd/go: go build ./... may or may not write executable to disk depending how many packages the import path pattern matches #39515
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
What version of Go are you using (
Does this issue reproduce with the latest release?
Issue is reproduced with the latest release.
What operating system and processor architecture are you using (
OS: macOS Catalina (10.15.5)
What did you do?
I am trying to build a go module using
go build ./...in the same directory as
go.mod. It works fine when there's only a single go package (main) and file. But adding another package and file, referencing those functions in main, and executing the aforementioned command does not generate the executable.
I have a very basic go project that reproduces this issue (includes instructions): https://github.com/xyzst/go-build-bug
What did you expect to see?
An executable should be generated in the same directory as
What did you see instead?
The binary is not generated and I am not able to locate it anywhere.
There are workarounds available:
go install ./...still works as intended and the binary is found in the expected location at
go build ./path/to/go/file/with/mainpkg.gowill generate the binary as expected
The text was updated successfully, but these errors were encountered: