From 112ba33de4de0c2d9cff7fe3bfc9a7000e2921e5 Mon Sep 17 00:00:00 2001 From: dmachard <5562930+dmachard@users.noreply.github.com> Date: Wed, 17 Jan 2024 09:35:26 +0100 Subject: [PATCH] Update protoc to v4.25.2 --- README.md | 49 +++++++++++++++++++++++++++++------------------- dnsmessage.pb.go | 4 ++-- go.mod | 2 +- go.sum | 2 ++ 4 files changed, 35 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index 121d9c2..0304fa4 100644 --- a/README.md +++ b/README.md @@ -73,35 +73,46 @@ ok github.com/dmachard/go-powerdns-protobuf 2.892s ## Development - Add the proto schema as git submodule - git submodule add https://github.com/PowerDNS/dnsmessage +```bash +git submodule add https://github.com/PowerDNS/dnsmessage +``` -Update golang version +Export GOBIN - go mod edit -go=1.20 - go mod tidy - -Download the latest release of protoc and protoc-gen-go +```bash +export GOROOT=/usr/local/go +export GOPATH=$HOME/go +export GOBIN=$GOPATH/bin +``` - export PROTOC_VER=22.2 - export GITHUB_URL=https://github.com/protocolbuffers - go install google.golang.org/protobuf/cmd/protoc-gen-go@latest - wget $GITHUB_URL/protobuf/releases/download/v$PROTOC_VER/protoc-$PROTOC_VER-linux-x86_64.zip - unzip protoc-$PROTOC_VER-linux-x86_64.zip +Update golang version -Export GOBIN +```bash +go mod edit -go=1.21 +go mod tidy +``` - export GOROOT=/usr/local/go - export GOPATH=$HOME/go - export GOBIN=$GOPATH/bin +Download the latest release of protoc and protoc-gen-go + +```bash +export PROTOC_VER=25.2 +export GITHUB_URL=https://github.com/protocolbuffers +go install google.golang.org/protobuf/cmd/protoc-gen-go@latest +wget $GITHUB_URL/protobuf/releases/download/v$PROTOC_VER/protoc-$PROTOC_VER-linux-x86_64.zip +unzip protoc-$PROTOC_VER-linux-x86_64.zip +``` Edit and past the following line in the dnsmessage.proto - option go_package = "github.com/dmachard/go-powerdns-protobuf;powerdns_protobuf"; +```bash +option go_package = "github.com/dmachard/go-powerdns-protobuf;powerdns_protobuf"; +``` Generate the golang package - cd dnsmessage/ - ../bin/protoc --proto_path=. --go_out=../ --go_opt=paths=source_relative --plugin protoc-gen-go=${GOBIN}/protoc-gen-go dnsmessage.proto +```bash +cd dnsmessage/ +../bin/protoc --proto_path=. --go_out=../ --go_opt=paths=source_relative --plugin protoc-gen-go=${GOBIN}/protoc-gen-go dnsmessage.proto +``` diff --git a/dnsmessage.pb.go b/dnsmessage.pb.go index 7016fdb..af69bb3 100644 --- a/dnsmessage.pb.go +++ b/dnsmessage.pb.go @@ -25,8 +25,8 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.30.0 -// protoc v4.22.2 +// protoc-gen-go v1.32.0 +// protoc v4.25.2 // source: dnsmessage.proto package powerdns_protobuf diff --git a/go.mod b/go.mod index 2517dda..199e849 100644 --- a/go.mod +++ b/go.mod @@ -1,5 +1,5 @@ module github.com/dmachard/go-powerdns-protobuf -go 1.20 +go 1.21 require google.golang.org/protobuf v1.32.0 diff --git a/go.sum b/go.sum index b010a4f..5361bc7 100644 --- a/go.sum +++ b/go.sum @@ -1,4 +1,6 @@ github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I= google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=