Bump protobuf lib and fix deprecation warnings (#285)

* Bump github.com/golang/protobuf from 1.4.2 to 1.5.2

Bumps [github.com/golang/protobuf](https://github.com/golang/protobuf) from 1.4.2 to 1.5.2.
- [Release notes](https://github.com/golang/protobuf/releases)
- [Commits](https://github.com/golang/protobuf/compare/v1.4.2...v1.5.2)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---

* Also pulls along update of golang.google.org/protobuf to v1.26
* Fix deprecation warnings about `ptypes` package
This commit is contained in:
Jeff Widman
2022-02-04 14:19:52 -08:00
committed by GitHub
parent 57a2cd1a09
commit b890db745f
3 changed files with 16 additions and 9 deletions

View File

@@ -5,7 +5,6 @@ import (
"fmt"
"time"
"github.com/golang/protobuf/ptypes"
"github.com/golang/protobuf/ptypes/empty"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
@@ -72,26 +71,29 @@ func (s *bankServer) GetTransactions(req *GetTransactionsRequest, stream Bank_Ge
var start, end time.Time
if req.Start != nil {
start, err = ptypes.Timestamp(req.Start)
err := req.Start.CheckValid()
if err != nil {
return err
}
start = req.Start.AsTime()
}
if req.End != nil {
end, err = ptypes.Timestamp(req.End)
err := req.End.CheckValid()
if err != nil {
return err
}
end = req.End.AsTime()
} else {
end = time.Date(9999, 12, 31, 23, 59, 59, 999999999, time.Local)
}
txns := acct.getTransactions()
for _, txn := range txns {
t, err := ptypes.Timestamp(txn.Date)
err := txn.Date.CheckValid()
if err != nil {
return err
}
t := txn.Date.AsTime()
if (t.After(start) || t.Equal(start)) &&
(t.Before(end) || t.Equal(end)) {