Skip to content

Update package for new protobuf #20

@PichuChen

Description

@PichuChen

OS version:

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 24.04.1 LTS
Release:        24.04
Codename:       noble

Golang version

$ go version
go version go1.24.0 linux/amd64

protoc-gen-go-grpc Version

$ protoc-gen-go-grpc -version
protoc-gen-go-grpc 1.5.1

protoc version:

$ protoc --version
libprotoc 3.21.12

Error message:

# github.com/ptt/pttweb/proto/man
proto/man/man.pb.go:463:57: unsafe.Slice requires go1.17 or later (-lang was set to go1.15; check go.mod)
proto/man/man.pb.go:463:70: unsafe.StringData requires go1.20 or later (-lang was set to go1.15; check go.mod)
proto/man/man.pb.go:470:32: predeclared any requires go1.18 or later (-lang was set to go1.15; check go.mod)
proto/man/man.pb.go:501:19: unsafe.Slice requires go1.17 or later (-lang was set to go1.15; check go.mod)
proto/man/man.pb.go:501:32: unsafe.StringData requires go1.20 or later (-lang was set to go1.15; check go.mod)
proto/man/man_grpc.pb.go:24:16: undefined: grpc.SupportPackageIsVersion9
proto/man/man_grpc.pb.go:48:41: undefined: grpc.StaticMethod
proto/man/man_grpc.pb.go:58:41: undefined: grpc.StaticMethod
proto/man/man_grpc.pb.go:99:38: undefined: grpc.ServiceRegistrar
# github.com/ptt/pttweb/proto/api
proto/api/board.pb.go:1282:59: unsafe.Slice requires go1.17 or later (-lang was set to go1.15; check go.mod)
proto/api/board.pb.go:1282:72: unsafe.StringData requires go1.20 or later (-lang was set to go1.15; check go.mod)
proto/api/board.pb.go:1289:34: predeclared any requires go1.18 or later (-lang was set to go1.15; check go.mod)
proto/api/board.pb.go:1346:49: predeclared any requires go1.18 or later (-lang was set to go1.15; check go.mod)
proto/api/board.pb.go:1354:19: unsafe.Slice requires go1.17 or later (-lang was set to go1.15; check go.mod)
proto/api/board.pb.go:1354:32: unsafe.StringData requires go1.20 or later (-lang was set to go1.15; check go.mod)
proto/api/board_grpc.pb.go:24:16: undefined: grpc.SupportPackageIsVersion9
proto/api/board_grpc.pb.go:54:41: undefined: grpc.StaticMethod
proto/api/board_grpc.pb.go:64:41: undefined: grpc.StaticMethod
proto/api/board_grpc.pb.go:147:40: undefined: grpc.ServiceRegistrar
proto/api/board_grpc.pb.go:64:41: too many errors

Planned repair steps:

  1. Update go.mod golang version to 1.23
  2. Update google.golang.org/grpc from v1.31.1 to v1.64.0
  3. Build binary

Opt. 4. Update deprecated func grpc.Dial

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions