go install does not recognize “-o” flag

前端 未结 2 2171
别那么骄傲
别那么骄傲 2021-02-04 06:52

I\'m trying to do a go install and rename the output with the -o flag.

go install -o bar.exe src/foo.go

But this fai

2条回答
  •  天命终不由人
    2021-02-04 07:28

    go build accepts the -o flag but go install does not.

    go install will always output to $GOPATH/bin

    If you want to install a custom binary name to your gopath you can do go build -o $GOPATH/bin/whatever and that will be roughly equivalent to go install

提交回复
热议问题