Skip to content

Commit

Permalink
Fix lint: Upgrade lib in go.mod by dependabot and clean go.mod/go.sum
Browse files Browse the repository at this point in the history
  • Loading branch information
tnasu committed Feb 25, 2022
1 parent 100d460 commit 2ee2c37
Show file tree
Hide file tree
Showing 16 changed files with 33 additions and 19 deletions.
6 changes: 5 additions & 1 deletion abci/client/grpc_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import (
"sync"
"time"

"google.golang.org/grpc/credentials/insecure"

"golang.org/x/net/context"
"google.golang.org/grpc"

Expand Down Expand Up @@ -54,7 +56,9 @@ func (cli *grpcClient) OnStart() error {

RETRY_LOOP:
for {
conn, err := grpc.Dial(cli.addr, grpc.WithInsecure(), grpc.WithContextDialer(dialerFunc))
conn, err := grpc.Dial(cli.addr,
grpc.WithTransportCredentials(insecure.NewCredentials()),
grpc.WithContextDialer(dialerFunc))
if err != nil {
if cli.mustConnect {
return err
Expand Down
8 changes: 6 additions & 2 deletions abci/example/example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import (
"testing"
"time"

"google.golang.org/grpc/credentials/insecure"

"github.com/stretchr/testify/require"

"google.golang.org/grpc"
Expand Down Expand Up @@ -130,7 +132,7 @@ func dialerFunc(ctx context.Context, addr string) (net.Conn, error) {

func testGRPCSync(t *testing.T, app types.ABCIApplicationServer) {
numDeliverTxs := 2000
socketFile := fmt.Sprintf("test-%08x.sock", rand.Int31n(1<<30))
socketFile := fmt.Sprintf("/tmp/test-%08x.sock", rand.Int31n(1<<30))
defer os.Remove(socketFile)
socket := fmt.Sprintf("unix://%v", socketFile)

Expand All @@ -148,7 +150,9 @@ func testGRPCSync(t *testing.T, app types.ABCIApplicationServer) {
})

// Connect to the socket
conn, err := grpc.Dial(socket, grpc.WithInsecure(), grpc.WithContextDialer(dialerFunc))
conn, err := grpc.Dial(socket,
grpc.WithTransportCredentials(insecure.NewCredentials()),
grpc.WithContextDialer(dialerFunc))
if err != nil {
t.Fatalf("Error dialing GRPC server: %v", err.Error())
}
Expand Down
2 changes: 1 addition & 1 deletion abci/example/kvstore/kvstore_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ func TestClientServer(t *testing.T) {

// set up grpc app
kvstore = NewApplication()
gclient, gserver, err := makeGRPCClientServer(kvstore, "kvstore-grpc")
gclient, gserver, err := makeGRPCClientServer(kvstore, "/tmp/kvstore-grpc")
require.NoError(t, err)

t.Cleanup(func() {
Expand Down
3 changes: 2 additions & 1 deletion consensus/common_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,14 @@ import (
"testing"
"time"

"github.com/go-kit/kit/log/term"
"github.com/go-kit/log/term"
"github.com/line/tm-db/v2/memdb"
"github.com/stretchr/testify/require"

dbm "github.com/line/tm-db/v2"

abcicli "github.com/line/ostracon/abci/client"

"github.com/line/ostracon/abci/example/counter"
"github.com/line/ostracon/abci/example/kvstore"
abci "github.com/line/ostracon/abci/types"
Expand Down
2 changes: 1 addition & 1 deletion crypto/armor/armor.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"fmt"
"io/ioutil"

"golang.org/x/crypto/openpgp/armor"
"golang.org/x/crypto/openpgp/armor" //nolint: staticcheck // nobody uses this package but leave for a moment
)

func EncodeArmor(blockType string, headers map[string]string, data []byte) string {
Expand Down
2 changes: 1 addition & 1 deletion evidence/reactor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"time"

"github.com/fortytw2/leaktest"
"github.com/go-kit/kit/log/term"
"github.com/go-kit/log/term"
"github.com/line/tm-db/v2/memdb"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock"
Expand Down
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ require (
github.com/coniks-sys/coniks-go v0.0.0-20180722014011-11acf4819b71
github.com/fortytw2/leaktest v1.3.0
github.com/go-kit/kit v0.12.0
github.com/go-kit/log v0.2.0
github.com/go-logfmt/logfmt v0.5.1
github.com/gogo/protobuf v1.3.2
github.com/golang/protobuf v1.5.2
Expand Down
2 changes: 1 addition & 1 deletion libs/log/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package log
import (
"io"

kitlog "github.com/go-kit/kit/log"
kitlog "github.com/go-kit/log"
)

// Logger is what any Ostracon library should take.
Expand Down
2 changes: 1 addition & 1 deletion libs/log/oc_json_logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package log
import (
"io"

kitlog "github.com/go-kit/kit/log"
kitlog "github.com/go-kit/log"
)

// NewOCJSONLogger returns a Logger that encodes keyvals to the Writer as a
Expand Down
6 changes: 3 additions & 3 deletions libs/log/oc_logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import (
"fmt"
"io"

kitlog "github.com/go-kit/kit/log"
kitlevel "github.com/go-kit/kit/log/level"
"github.com/go-kit/kit/log/term"
kitlog "github.com/go-kit/log"
kitlevel "github.com/go-kit/log/level"
"github.com/go-kit/log/term"
)

const (
Expand Down
4 changes: 2 additions & 2 deletions libs/log/ocfmt_logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (
"sync"
"time"

kitlog "github.com/go-kit/kit/log"
kitlevel "github.com/go-kit/kit/log/level"
kitlog "github.com/go-kit/log"
kitlevel "github.com/go-kit/log/level"
"github.com/go-logfmt/logfmt"
)

Expand Down
2 changes: 1 addition & 1 deletion libs/log/ocfmt_logger_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"regexp"
"testing"

kitlog "github.com/go-kit/kit/log"
kitlog "github.com/go-kit/log"
"github.com/stretchr/testify/assert"

"github.com/line/ostracon/libs/log"
Expand Down
2 changes: 1 addition & 1 deletion libs/log/testing_logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"os"
"testing"

"github.com/go-kit/kit/log/term"
"github.com/go-kit/log/term"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion mempool/reactor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"time"

"github.com/fortytw2/leaktest"
"github.com/go-kit/kit/log/term"
"github.com/go-kit/log/term"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

Expand Down
6 changes: 5 additions & 1 deletion rpc/grpc/client_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ package coregrpc
import (
"net"

"google.golang.org/grpc/credentials/insecure"

"golang.org/x/net/context"
"google.golang.org/grpc"

Expand All @@ -26,7 +28,9 @@ func StartGRPCServer(ln net.Listener) error {
// StartGRPCClient dials the gRPC server using protoAddr and returns a new
// BroadcastAPIClient.
func StartGRPCClient(protoAddr string) BroadcastAPIClient {
conn, err := grpc.Dial(protoAddr, grpc.WithInsecure(), grpc.WithContextDialer(dialerFunc))
conn, err := grpc.Dial(protoAddr,
grpc.WithTransportCredentials(insecure.NewCredentials()),
grpc.WithContextDialer(dialerFunc))
if err != nil {
panic(err)
}
Expand Down
2 changes: 1 addition & 1 deletion rpc/jsonrpc/jsonrpc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"testing"
"time"

"github.com/go-kit/kit/log/term"
"github.com/go-kit/log/term"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

Expand Down

0 comments on commit 2ee2c37

Please sign in to comment.