-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Description
Go version
go version go1.25.3 darwin/arm64
Output of go env in your module/workspace:
AR='ar'
CC='clang'
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_ENABLED='1'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
CXX='clang++'
GCCGO='gccgo'
GO111MODULE=''
GOARCH='arm64'
GOARM64='v8.0'
GOAUTH='netrc'
GOBIN=''
GOCACHE='/Users/rav/Library/Caches/go-build'
GOCACHEPROG=''
GODEBUG=''
GOENV='/Users/rav/Library/Application Support/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFIPS140='off'
GOFLAGS=''
GOGCCFLAGS='-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -ffile-prefix-map=/var/folders/kz/2d_vhlks21l3g0s4g5yytlwr0000gn/T/go-build2717402467=/tmp/go-build -gno-record-gcc-switches -fno-common'
GOHOSTARCH='arm64'
GOHOSTOS='darwin'
GOINSECURE=''
GOMOD='/Users/rav/src/teleport-jj/go.mod'
GOMODCACHE='/Users/rav/go/pkg/mod'
GONOPROXY='github.com/gravitational/*'
GONOSUMDB='github.com/gravitational/*'
GOOS='darwin'
GOPATH='/Users/rav/go'
GOPRIVATE='github.com/gravitational/*'
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/Users/rav/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.25.3.darwin-arm64'
GOSUMDB='sum.golang.org'
GOTELEMETRY='local'
GOTELEMETRYDIR='/Users/rav/Library/Application Support/go/telemetry'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/Users/rav/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.25.3.darwin-arm64/pkg/tool/darwin_arm64'
GOVCS=''
GOVERSION='go1.25.3'
GOWORK='/Users/rav/src/teleport-jj/go.work'
PKG_CONFIG='pkg-config'What did you do?
I'm using golang.org/x/mobile@v0.0.0-20251021151156-188f512ec823. I defined a struct which looks like this:
package foo
type DeviceCredential struct {
ID string
PublicKeyDER []byte
}On the Obj-C/Swift side, the field gets correctly renamed to id_. I use the generated framework in a Swift app.
let dc = FooDeviceCredential()
dc.id_ = // …
dc.publicKeyDER = // …I then passed this struct from Swift to a Go function exposed through gomobile.
What did you see happen?
When reading the ID field on the Go side, the string appears to be empty.
From what I gathered, #12958 was fixed by a change that avoids reserved Obj-C keywords. But maybe there was a regression or the original fix did not properly read back the changed fields.
This issue is similar to #32008, where a field is not properly read back if it starts with an acronym, e.g.:
type Config struct {
OSName string
OSDevice string
}What did you expect to see?
I expected to see the same string that was set on the Swift side.