We are getting "ProtoPackageIsVersion4" for Go, but what should we update? I thought google.golang.org was the future?

29 views
Skip to first unread message

Christoffer Pettersson

unread,
Apr 16, 2020, 6:52:23 AM4/16/20
to Protocol Buffers
Hey

We are confused about something.

When we generate our .proto files, they are now referring to:


import (
reflect "reflect"
sync "sync"

proto "github.com/golang/protobuf/proto"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
)

According to FAQ, it says it is because we are using an old version of github.com/golang/protobuf:


But everywhere it says google.golang.org/protobuf should be used, and not github.com/golang/protobuf

So this is really confusing.

We are using protoc version 3.11.4 (the latest) and protoc-gen-go 1.21 (the latest) and using Protocol Buffers v3 syntax.

Why is protoc 3.11.4 and protoc-gen-go stil use github.com and not google.golang.org?

And how do fix it? Is it possible to make protoc-gen-go use google.golang.org for the auto-generated Go-files?


Thanks for any response,

// Christoffer
Reply all
Reply to author
Forward
0 new messages