Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unmarshaling data that was marshaled using Google's proto.Marshal() omits protobuf extensions #695

Open
dylan-bourque opened this issue Jun 4, 2020 · 0 comments
Labels
apiv2 Issues blocking Go protobuf APIv2 compatibility

Comments

@dylan-bourque
Copy link

It appears that there is an incompatibility between Google's proto.Marhsal() and Gogo's proto.Unmarshal().

Given a protobuf structure with an extension (assigned with proto.SetExtension()), if I marshal it to binary using Google's proto.Marshal() function then unmarshal it using Gogo's proto.Unmarshal() the resulting structure has its XXX_InternalExtensions field set to nil.

Possibly relevant, I am building a "legacy" project in GOPATH mode (explicitly not using Go modules).

Relevant Go environment:

go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/dbourque/Library/Caches/go-build"
GOENV="/Users/dbourque/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GOOS="darwin"
GOPATH="/Users/dbourque/dev/golang"
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/Cellar/go/1.14.3/libexec"
GOTOOLDIR="/usr/local/Cellar/go/1.14.3/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CGO_ENABLED="1"
GOMOD=""
Package Version Commit
github.com/gogo/protobuf v1.3.1 5628607
github.com/golang/protobuf v1.4.2 d04d7b157bb510b1e0c10132224b616ac0e26b17
google.golang.org/protobuf v1.24.0 + 6 commits 69839c78c3baff8f1fb37f37b24127ecae185e03
@johanbrandhorst johanbrandhorst added the apiv2 Issues blocking Go protobuf APIv2 compatibility label Aug 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
apiv2 Issues blocking Go protobuf APIv2 compatibility
Projects
None yet
Development

No branches or pull requests

2 participants