From 39d8c68b3cd6d72f3289e8879f324ab0b7418963 Mon Sep 17 00:00:00 2001 From: Siddhartha Basu Date: Wed, 18 Aug 2021 08:52:51 -0500 Subject: [PATCH] refactor: update golang protobuf package to use latest import path --- date.go | 13 +++++-------- go.mod | 4 +++- go.sum | 7 +++---- 3 files changed, 11 insertions(+), 13 deletions(-) diff --git a/date.go b/date.go index dcc1e91..9bf0383 100644 --- a/date.go +++ b/date.go @@ -3,16 +3,13 @@ package aphgrpc import ( "time" - "github.com/golang/protobuf/ptypes" - "github.com/golang/protobuf/ptypes/timestamp" + "google.golang.org/protobuf/types/known/timestamppb" ) -func ProtoTimeStamp(ts *timestamp.Timestamp) time.Time { - t, _ := ptypes.Timestamp(ts) - return t +func ProtoTimeStamp(ts *timestamppb.Timestamp) time.Time { + return ts.AsTime() } -func TimestampProto(t time.Time) *timestamp.Timestamp { - ts, _ := ptypes.TimestampProto(t) - return ts +func TimestampProto(t time.Time) *timestamppb.Timestamp { + return timestamppb.New(t) } diff --git a/go.mod b/go.mod index d6d7bdb..b6390ee 100644 --- a/go.mod +++ b/go.mod @@ -1,10 +1,12 @@ module github.com/dictyBase/aphgrpc +go 1.13 + require ( github.com/fatih/structs v1.1.0 - github.com/golang/protobuf v1.5.2 github.com/urfave/cli v1.22.5 golang.org/x/net v0.0.0-20191119073136-fc4aabc6c914 // indirect golang.org/x/sys v0.0.0-20191008105621-543471e840be // indirect google.golang.org/grpc v1.36.0 + google.golang.org/protobuf v1.27.1 ) diff --git a/go.sum b/go.sum index 4787ea4..9719b9d 100644 --- a/go.sum +++ b/go.sum @@ -23,9 +23,8 @@ github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:W github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.5.0 h1:LUVKkCeviFUMKqHa4tXIIij/lbhnMbP7Fn5wKdKkRh4= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= -github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= @@ -94,8 +93,8 @@ google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2 google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk= -google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= +google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=