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: go install generates exe in the bin directory directly without any package path #21058

Closed
GingerMoon opened this issue Jul 18, 2017 · 1 comment

Comments

@GingerMoon
Copy link

Please answer these questions before submitting your issue. Thanks!

What version of Go are you using (go version)?

go version go1.8.3 windows/amd64

What operating system and processor architecture are you using (go env)?

set GOARCH=amd64
set GOBIN=
set GOEXE=.exe
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOOS=windows
set GOPATH=C:\Users\xwang24\Documents\goWorkspace
set GORACE=
set GOROOT=C:\Go
set GOTOOLDIR=C:\Go\pkg\tool\windows_amd64
set GCCGO=gccgo
set CC=gcc
set GOGCCFLAGS=-m64 -mthreads -fmessage-length=0
set CXX=g++
set CGO_ENABLED=1
set PKG_CONFIG=pkg-config
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2

What did you do?

I have two packages:
src/github.com/user1/hello/hello.go
src/github.com/user2/hello/hello.go
After the first hello.go is installed, hello.exe is generated under bin/,
then after the second hello.go is installed, hello.exe generated by the previous one is overridden.

If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
A link on play.golang.org is best.

What did you expect to see?

the generated exe should be under bin/package info.
For example,
bin/github.com/user1/hello/hello.exe

What did you see instead?

bin/hello.exe

@bradfitz
Copy link
Contributor

This is working as designed and as documented.

You can set GOBIN. See https://golang.org/cmd/go/#hdr-Environment_variables.

@mikioh mikioh changed the title go install generates exe in the bin directory directly without any package path cmd/go: go install generates exe in the bin directory directly without any package path Jul 21, 2017
@golang golang locked and limited conversation to collaborators Jul 21, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants