Skip to content

Instantly share code, notes, and snippets.

@kyoh86
Last active March 18, 2019 00:05
Show Gist options
  • Save kyoh86/1db4f5d8f15c1e7bedb76ef57d8853c7 to your computer and use it in GitHub Desktop.
Save kyoh86/1db4f5d8f15c1e7bedb76ef57d8853c7 to your computer and use it in GitHub Desktop.
play.golang.org does not equal to darwin
package main
import (
"fmt"
"os"
)
func main() {
_, err := os.Stat("")
fmt.Println(err)
fmt.Println(os.IsNotExist(err))
}
$ go run main.go
stat : no such file or directory
true
$ docker run --rm -it -v $PWD:/go/src/github.com/kyoh86/tryout -w /go/src/github.com/kyoh86/tryout golang:latest go run main.go
stat : no such file or directory
true
// https://play.golang.org/p/HcShoLxLj5_t
stat : Invalid argument
false
Program exited.
$ go version
go version go1.12.1 darwin/amd64
$ go env
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/kyoh86/Library/Caches/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/kyoh86/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/Cellar/go/1.12.1/libexec"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.12.1/libexec/pkg/tool/darwin_amd64
"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/kyoh86/Projects/github.com/kyoh86/gogh/go.mod"
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 -fno-caret-diagnostics -Qunused-argu
ments -fmessage-length=0 -fdebug-prefix-map=/var/folders/90/1ymfxwdx
67d3f33zz1qkchdw0000gn/T/go-build293153577=/tmp/go-build -gno-record
-gcc-switches -fno-common"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment