$ go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
$ protoc-gen-go --version
protoc-gen-go v1.34.2
$ sh make.sh
user.pb.go:123:45: undeclared name: any (requires version go1.18 or later)



protoc -I=./ --proto_path=./ --go_out=./ --go_opt=paths=source_relative user.proto 


go build






protoc-gen-go’s versions

Versions in this module
    v1.34.2 Jun 11, 2024
    v1.34.1 May 6, 2024
    v1.34.0 Apr 30, 2024
    v1.33.0 Mar 5, 2024
    v1.32.0 Dec 22, 2023

Protobuf Editions Overview

Protobuf Editions replace the proto2 and proto3 designations that we have used for Protocol Buffers. Instead of adding syntax = “proto2” or syntax = “proto3” at the top of proto definition files, you use an edition number, such as edition = “2024”, to specify the default behaviors your file will have. Editions enable the language to evolve incrementally over time.

Instead of the hardcoded behaviors that older versions have had, editions represent a collection of features with a default value (behavior) per feature. Features are options on a file, message, field, enum, and so on, that specify the behavior of protoc, the code generators, and protobuf runtimes. You can explicitly override a behavior at those different levels (file, message, field, …) when your needs don’t match the default behavior for the edition you’ve selected. You can also override your overrides. The section later in this topic on lexical scoping goes into more detail on that.


go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.33.0