On Wednesday, December 6, 2017 at 4:52:11 AM UTC+1, Srinivas Gowda wrote: > > I'm trying to ship a golang binary inside a mac app. It is ideally just a > http server with some basic functions on folders and files. > > The binary seems to work just fine when I run it from a terminal but when > I try calling it from my mac app programmatically it gives an error > "operation not permitted" and quits. >
To me that sounds like your Go binary is trying to write somewhere where it does not have write access. You should check that your go binary does not assume that it's running in a directory where it can write because if after the install it's in the Application folders it won't have write access. > Even after code-signing with a valid identity file I get the same error. > > go build -ldflags -s . > codesign -s "Developer ID Application: *** *tesco" binaryFile > > My Golang ENV: > > GOARCH="amd64" > GOBIN="" > GOEXE="" > GOHOSTARCH="amd64"GOHOSTOS="darwin" > GOOS="darwin" > GOPATH="/Users/srinivas/go" > GORACE="" > GOROOT="/usr/local/go" > GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64" > GCCGO="gccgo" > CC="clang" > GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments > -fmessage-length=0 -fdebug-prefix-map=/var/folders/3n/vpg5bnks45n75n > d91qh7sy3c0000gn/T/go-build925744934=/tmp/go-build > -gno-record-gcc-switches -fno-common" > CXX="clang++" > CGO_ENABLED="1" > PKG_CONFIG="pkg-config" > CGO_CFLAGS="-g -O2" > CGO_CPPFLAGS="" > CGO_CXXFLAGS="-g -O2" > CGO_FFLAGS="-g -O2" > CGO_LDFLAGS="-g -O2" > -- 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+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.