Skip to content

Commit

Permalink
Fix lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
emadolsky committed Jul 4, 2022
1 parent 423a4f2 commit c22e4f4
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 11 deletions.
3 changes: 2 additions & 1 deletion api/sample/cache-query/cache-query.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"time"

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

"github.com/go-graphite/go-carbon/helper/carbonpb"
)
Expand All @@ -20,7 +21,7 @@ func main() {
flag.Parse()

ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
conn, err := grpc.DialContext(ctx, *server, grpc.WithInsecure(), grpc.WithBlock())
conn, err := grpc.DialContext(ctx, *server, grpc.WithTransportCredentials(insecure.NewCredentials()), grpc.WithBlock())
if err != nil {
log.Fatalf("did not connect: %v", err)
}
Expand Down
8 changes: 4 additions & 4 deletions carbonserver/carbonserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ import (
"encoding/json"
"errors"
"fmt"
"github.com/go-graphite/protocol/carbonapi_v2_grpc"
"google.golang.org/grpc"
"io"
"math"
"net"
Expand Down Expand Up @@ -52,11 +50,13 @@ import (
"github.com/go-graphite/go-carbon/helper"
"github.com/go-graphite/go-carbon/helper/stat"
"github.com/go-graphite/go-carbon/points"
grpcv2 "github.com/go-graphite/protocol/carbonapi_v2_grpc"
protov3 "github.com/go-graphite/protocol/carbonapi_v3_pb"
"github.com/lomik/zapwriter"
"github.com/syndtr/goleveldb/leveldb"
"github.com/syndtr/goleveldb/leveldb/filter"
"github.com/syndtr/goleveldb/leveldb/opt"
"google.golang.org/grpc"
)

type metricStruct struct {
Expand Down Expand Up @@ -210,7 +210,7 @@ func (q *queryCache) getQueryItem(k string, size uint64, expire int32) *QueryIte
}

type CarbonserverListener struct {
carbonapi_v2_grpc.UnimplementedCarbonV2Server
grpcv2.UnimplementedCarbonV2Server
helper.Stoppable
cacheGet func(key string) []points.Point
readTimeout time.Duration
Expand Down Expand Up @@ -1998,7 +1998,7 @@ func (listener *CarbonserverListener) ListenGRPC(listen string) error {
var opts []grpc.ServerOption

grpcServer := grpc.NewServer(opts...)
carbonapi_v2_grpc.RegisterCarbonV2Server(grpcServer, listener)
grpcv2.RegisterCarbonV2Server(grpcServer, listener)
go grpcServer.Serve(listener.grpcListener)
return nil
}
10 changes: 5 additions & 5 deletions carbonserver/render.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ import (
"context"
"encoding/json"
"fmt"
"github.com/go-graphite/protocol/carbonapi_v2_grpc"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/peer"
"google.golang.org/grpc/status"
"io/ioutil"
"math"
"net/http"
Expand All @@ -19,8 +15,12 @@ import (
"time"

"go.uber.org/zap"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/peer"
"google.golang.org/grpc/status"

"github.com/go-graphite/carbonzipper/zipper/httpHeaders"
grpcv2 "github.com/go-graphite/protocol/carbonapi_v2_grpc"
protov2 "github.com/go-graphite/protocol/carbonapi_v2_pb"
protov3 "github.com/go-graphite/protocol/carbonapi_v3_pb"
pickle "github.com/lomik/og-rek"
Expand Down Expand Up @@ -675,7 +675,7 @@ func (listener *CarbonserverListener) fetchDataPB(metric string, files []string,
return &multi, nil
}

func (listener *CarbonserverListener) Render(req *protov2.MultiFetchRequest, stream carbonapi_v2_grpc.CarbonV2_RenderServer) (rpcErr error) {
func (listener *CarbonserverListener) Render(req *protov2.MultiFetchRequest, stream grpcv2.CarbonV2_RenderServer) (rpcErr error) {
t0 := time.Now()
ctx := stream.Context()

Expand Down
3 changes: 2 additions & 1 deletion receiver/pubsub/pubsub_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"github.com/stretchr/testify/assert"
"google.golang.org/api/option"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"
)

var (
Expand All @@ -24,7 +25,7 @@ func newTestClient() (*pstest.Server, *pubsub.Topic, *pubsub.Client, error) {
ctx := context.Background()
srv := pstest.NewServer()
srv.SetStreamTimeout(500 * time.Millisecond)
conn, err := grpc.Dial(srv.Addr, grpc.WithInsecure())
conn, err := grpc.Dial(srv.Addr, grpc.WithTransportCredentials(insecure.NewCredentials()))
if err != nil {
return nil, nil, nil, err
}
Expand Down

0 comments on commit c22e4f4

Please sign in to comment.