I'm trying to ship a golang binary inside a Mac application. It is ideally just an 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 to call it from my Mac application programmatically it gives me an error "operation not permitted" and quits.
After code-signing with a valid identity file I get the same error.
Error:
go build -ldflags -s .
codesign -s "Developer ID Application: *** *tesco" binaryFile
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"