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

go build creates binary named "command-line-arguments" #34716

Closed
kdeberk opened this issue Oct 6, 2019 · 3 comments
Closed

go build creates binary named "command-line-arguments" #34716

kdeberk opened this issue Oct 6, 2019 · 3 comments

Comments

@kdeberk
Copy link

kdeberk commented Oct 6, 2019

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

$ go version
go version go1.13.1 linux/amd64

Does this issue reproduce with the latest release?

Yes

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

go env Output
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/dberk/.cache/go-build"
GOENV="/home/dberk/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/dberk/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/lib/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/lib/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build727171168=/tmp/go-build -gno-record-gcc-switches"

What did you do?

> mkdir helloworld
> write an example hello world program in helloworld/helloworld.go
> go build helloworld/helloworld.go

What did you expect to see?

A binary in helloworld named helloworld

What did you see instead?

A binary named "command-line-arguments"

[dberk learninggo :)]$ go build helloworld/helloworld.go
[dberk learninggo :)]$ ls helloworld/
command-line-arguments  helloworld.go
[dberk learninggo :)]$ ./helloworld/command-line-arguments
Hello, World!

If I execute go build directly from that directory, the name is correct

[dberk helloworld :)]$ go build helloworld.go
[dberk helloworld :)]$ ls
command-line-arguments  helloworld  helloworld.go
[dberk helloworld :)]$ md5sum helloworld
8fcbdb0c84650e49878bda0d9e96ddc4  helloworld
[dberk helloworld :)]$ md5sum command-line-arguments
8fcbdb0c84650e49878bda0d9e96ddc4  command-line-arguments
@cuonglm
Copy link
Member

cuonglm commented Oct 6, 2019

seems duplicate of #34535

@kdeberk
Copy link
Author

kdeberk commented Oct 6, 2019

Indeed, that seems to refer to the same issue. I tried to look for command-line-arguments on google and github but it seems that the dashes are stripped from command-line-arguments before the search is executed and that just returns a whole lot of results not directly related to my issue.

@ALTree
Copy link
Member

ALTree commented Oct 6, 2019

Since this appears to be 1) a known issue and 2) already solved on tip, I think we can close this as a dup of #34535.

@ALTree ALTree closed this as completed Oct 6, 2019
@golang golang locked and limited conversation to collaborators Oct 5, 2020
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

4 participants