Skip to content

Commit

Permalink
Resolve gogo proto deprecation
Browse files Browse the repository at this point in the history
Move away from gogo proto to resolve CI failures related to its
deprecation.
  • Loading branch information
masih committed Mar 6, 2023
1 parent 80b4a5f commit 52ef0e5
Show file tree
Hide file tree
Showing 10 changed files with 211 additions and 380 deletions.
5 changes: 3 additions & 2 deletions api/v0/finder/client/libp2p/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
"github.com/libp2p/go-libp2p/core/peer"
"github.com/multiformats/go-multiaddr"
"github.com/multiformats/go-multihash"
"google.golang.org/protobuf/proto"
)

type Client struct {
Expand Down Expand Up @@ -123,9 +124,9 @@ func (c *Client) GetStats(ctx context.Context) (*model.Stats, error) {
}

func (c *Client) sendRecv(ctx context.Context, req *pb.FinderMessage, expectRspType pb.FinderMessage_MessageType) ([]byte, error) {
resp := new(pb.FinderMessage)
var resp pb.FinderMessage
err := c.p2pc.SendRequest(ctx, req, func(data []byte) error {
return resp.Unmarshal(data)
return proto.Unmarshal(data, &resp)
})
if err != nil {
return nil, fmt.Errorf("failed to send request to indexer: %s", err)
Expand Down
2 changes: 1 addition & 1 deletion api/v0/finder/pb/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ GO = $(PB:.proto=.pb.go)
all: $(GO)

%.pb.go: %.proto
protoc --proto_path=$(GOPATH)/pkg/mod:. --proto_path=/usr/include --gogofaster_out=. $<
docker run -v $(CURDIR):/defs -w /defs namely/protoc-all -d . -l go --go-module-prefix github.com/ipni/storetheindex/api/v0/finder/pb -o .

clean:
rm -f *.pb.go
Expand Down
Loading

0 comments on commit 52ef0e5

Please sign in to comment.