what is the meaning of ENV GOEXE

962 views
Skip to first unread message

andyxning

unread,
Aug 13, 2016, 7:51:35 AM8/13/16
to golang-nuts
when run `go env`, i get the following output:

```
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/andy/Github/go"
GORACE=""
GOROOT="/usr/local/go"
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GO15VENDOREXPERIMENT="1"
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fno-common"
CXX="clang++"
CGO_ENABLED="1"
```

what makes me confused is the GOEXE env, i googled it but found nothing.

Anmol Sethi

unread,
Aug 13, 2016, 8:01:41 AM8/13/16
to andyxning, golang-nuts
I looked in the Go source code. You can’t actually set it as a environment variable. It’s the value of the executable suffix. It’s set automatically in build.go. Like if running on windows, it is '.exe’ or for c-archives it is ‘.a’.

I don’t think it matters for an end user.
> --
> You received this message because you are subscribed to the Google Groups "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Andy Xie

unread,
Aug 13, 2016, 8:52:21 AM8/13/16
to Anmol Sethi, golang-nuts
​thanks. Just run `go env` and see it and is curious about it.


======= 
Ning Xie


> To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages