mennanov / fmutils

Golang protobuf FieldMask missing utils
MIT License
99 stars 10 forks source link

Regenerating testproto code with latest Protobuf will remove dependency on protobuf v1 module #4

Closed pkwarren closed 3 years ago

pkwarren commented 3 years ago

In the latest version of protoc-gen-go, the hard dependency on the v1 protobuf api (github.com/golang/protobuf) has been removed. I noticed that this project isn't using any v1 APIs, so by regenerating the testproto/testproto.pb.go file it will be possible to further clean up the go.mod dependencies.

I did need to update the go_package setting to add a full module path for protoc to work:

diff --git a/testproto/testproto.proto b/testproto/testproto.proto
index b2b6be4..b1f2eaa 100644
--- a/testproto/testproto.proto
+++ b/testproto/testproto.proto
@@ -2,7 +2,7 @@ syntax = "proto3";

 package testproto;

-option go_package = ".;testproto";
+option go_package = "github.com/mennanov/fmutils/testproto;testproto";

 import "google/protobuf/any.proto";
 import "google/protobuf/field_mask.proto";
mennanov commented 3 years ago

Please, check this new release https://github.com/mennanov/fmutils/releases/tag/v0.1.1

Thanks for your contribution!