Go version
go.1.21
Output of go env
in your module/workspace:
GO111MODULE='auto'
GOARCH='amd64'
GOBIN=''
GOCACHE='/root/.cache/go-build'
GOENV='/root/.config/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='amd64'
GOHOSTOS='linux'
GOINSECURE=''
GOMODCACHE='/root/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='linux'
GOPATH='/root/go'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/usr/local/go'
GOSUMDB='sum.golang.org'
GOTMPDIR='/root/go/tmp'
GOTOOLCHAIN='auto'
GOTOOLDIR='/usr/local/go/pkg/tool/linux_amd64'
GOVCS=''
GOVERSION='go1.21.4'
GCCGO='gccgo'
GOAMD64='v1'
AR='ar'
CC='gcc'
CXX='g++'
CGO_ENABLED='1'
GOMOD=''
GOWORK=''
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
PKG_CONFIG='pkg-config'
GOGCCFLAGS='-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/root/go/tmp/go-build3305027803=/tmp/go-build -gno-record-gcc-switches
What did you do?
can golang call c go to get args before golang runtime running? I want to solve this problem change from env to args https://github.com/opencontainers/runc/pull/4339. I want c go can receive args instead of env. https://github.com/opencontainers/runc/blob/main/libcontainer/nsenter/nsenter.go https://github.com/opencontainers/runc/blob/main/libcontainer/nsenter/nsexec.c
What did you see happen?
golang can't call cgo to get args.
What did you expect to see?
can golang call c go to get args before golang runtime running? I want to solve this problem change from env to agrs https://github.com/opencontainers/runc/pull/4339