Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/go: output of 'go build' in module mode is the major version #28004

Closed
hyangah opened this issue Oct 4, 2018 · 5 comments

Comments

Projects
None yet
4 participants
@hyangah
Copy link
Contributor

commented Oct 4, 2018

If the module version is vN (N > 1) and the main package is defined in the root of the module,
the binary name is 'vN'.

$ git clone https://github.com/hyangah/foo.git /tmp/foo
$ cd /tmp/foo
$ cat go.mod
module github.com/hyangah/foo/v2
$ ls
go.mod	lib	main.go
$ go build
$ ./v2
version 2

@hyangah hyangah added the modules label Oct 4, 2018

@agnivade

This comment has been minimized.

Copy link
Member

commented Oct 4, 2018

Looks like in module mode, the binary name is taken from package name instead of the dir name.

@bcmills

@agnivade agnivade added this to the Go1.11.2 milestone Oct 4, 2018

@mvdan

This comment has been minimized.

Copy link
Member

commented Oct 4, 2018

Would this not have been fixed with #24667? Or is this case different?

@agnivade agnivade modified the milestones: Go1.11.2, Go1.12 Oct 4, 2018

@agnivade

This comment has been minimized.

Copy link
Member

commented Oct 4, 2018

Duh .. mistakenly marked it as 1.11.2.

@hyangah

This comment has been minimized.

Copy link
Contributor Author

commented Oct 4, 2018

@mvdan 'install' works as intended in #24667. Didn't look into the code path carefully and I am guessing 'build' picks the default output name in a different way.

@bcmills

This comment has been minimized.

Copy link
Member

commented Oct 4, 2018

Dup of #27283.

@bcmills bcmills closed this Oct 4, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.