From f09ed5b8517d38eeb6b81f67d0e5f343b2d4b050 Mon Sep 17 00:00:00 2001 From: Ryan Christoffersen <12519942+ryanchristo@users.noreply.github.com> Date: Wed, 24 Aug 2022 09:49:27 -0700 Subject: [PATCH] style: fix lint errors using latest golanci (#1403) --- .golangci.yml | 1 - types/timestamp.go | 3 +-- x/data/server/server.go | 1 + x/ecocredit/server/server.go | 1 + 4 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 42ec899b75..f7de5a8d78 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -5,7 +5,6 @@ linters: disable-all: true enable: - bodyclose - - deadcode - depguard - dogsled - errcheck diff --git a/types/timestamp.go b/types/timestamp.go index ab5ff78e13..feea22f772 100644 --- a/types/timestamp.go +++ b/types/timestamp.go @@ -5,7 +5,6 @@ import ( "time" gogotypes "github.com/gogo/protobuf/types" - "github.com/pkg/errors" "google.golang.org/protobuf/types/known/durationpb" "google.golang.org/protobuf/types/known/timestamppb" ) @@ -47,7 +46,7 @@ func GogoToProtobufDuration(d *gogotypes.Duration) *durationpb.Duration { func ParseDate(field string, date string) (time.Time, error) { t, err := time.Parse("2006-01-02", date) if err != nil { - return t, errors.New(fmt.Sprintf("%s must have format yyyy-mm-dd, but received %v", field, date)) + return t, fmt.Errorf("%s must have format yyyy-mm-dd, but received %v", field, date) } return t, nil } diff --git a/x/data/server/server.go b/x/data/server/server.go index 790a46fa40..0fba0c6e7f 100644 --- a/x/data/server/server.go +++ b/x/data/server/server.go @@ -38,6 +38,7 @@ func (s serverImpl) QueryServer() data.QueryServer { return s } +//nolint:revive func NewServer(storeKey storetypes.StoreKey, ak data.AccountKeeper, bk data.BankKeeper) serverImpl { hasher, err := hasher.NewHasher() if err != nil { diff --git a/x/ecocredit/server/server.go b/x/ecocredit/server/server.go index 8bae03c1e4..46c28f879b 100644 --- a/x/ecocredit/server/server.go +++ b/x/ecocredit/server/server.go @@ -35,6 +35,7 @@ type serverImpl struct { basketStore basketapi.StateStore } +//nolint:revive func NewServer(storeKey storetypes.StoreKey, paramSpace paramtypes.Subspace, accountKeeper ecocredit.AccountKeeper, bankKeeper ecocredit.BankKeeper, authority sdk.AccAddress) serverImpl { s := serverImpl{