Skip to content

Commit

Permalink
Fix golint errors for non-generated code
Browse files Browse the repository at this point in the history
  • Loading branch information
bufdev committed May 8, 2015
1 parent 5a3d065 commit 5700d19
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion benchmark/benchmark.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ func (s *testServer) FullDuplexCall(stream testpb.TestService_FullDuplexCallServ
}

func (s *testServer) HalfDuplexCall(stream testpb.TestService_HalfDuplexCallServer) error {
msgBuf := make([]*testpb.StreamingOutputCallRequest, 0)
var msgBuf []*testpb.StreamingOutputCallRequest
for {
in, err := stream.Recv()
if err == io.EOF {
Expand Down
4 changes: 2 additions & 2 deletions benchmark/stats/counter.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
)

var (
// Used for testing.
TimeNow func() time.Time = time.Now
// TimeNow is used for testing.
TimeNow = time.Now
)

const (
Expand Down
1 change: 1 addition & 0 deletions credentials/credentials.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ type TokenSource struct {
oauth2.TokenSource
}

// GetRequestMetadata gets the request metadata as a map from a TokenSource.
func (ts TokenSource) GetRequestMetadata(ctx context.Context) (map[string]string, error) {
token, err := ts.Token()
if err != nil {
Expand Down
6 changes: 3 additions & 3 deletions interop/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ import (
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/credentials"
"google.golang.org/grpc/metadata"
testpb "google.golang.org/grpc/interop/grpc_testing"
"google.golang.org/grpc/metadata"
)

var (
Expand Down Expand Up @@ -268,7 +268,7 @@ func doComputeEngineCreds(tc testpb.TestServiceClient) {
log.Println("ComputeEngineCreds done")
}

func getServiceAccountJsonKey() []byte {
func getServiceAccountJSONKey() []byte {
jsonKey, err := ioutil.ReadFile(*serviceAccountKeyFile)
if err != nil {
log.Fatalf("Failed to read the service account key file: %v", err)
Expand All @@ -289,7 +289,7 @@ func doServiceAccountCreds(tc testpb.TestServiceClient) {
if err != nil {
log.Fatal("/TestService/UnaryCall RPC failed: ", err)
}
jsonKey := getServiceAccountJsonKey()
jsonKey := getServiceAccountJSONKey()
user := reply.GetUsername()
scope := reply.GetOauthScope()
if !strings.Contains(string(jsonKey), user) {
Expand Down
2 changes: 1 addition & 1 deletion interop/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ func (s *testServer) FullDuplexCall(stream testpb.TestService_FullDuplexCallServ
}

func (s *testServer) HalfDuplexCall(stream testpb.TestService_HalfDuplexCallServer) error {
msgBuf := make([]*testpb.StreamingOutputCallRequest, 0)
var msgBuf []*testpb.StreamingOutputCallRequest
for {
in, err := stream.Recv()
if err == io.EOF {
Expand Down
4 changes: 2 additions & 2 deletions transport/transport_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ func TestServerWithMisbehavedClient(t *testing.T) {
time.Sleep(time.Millisecond)
continue
}
for k, _ := range server.conns {
for k := range server.conns {
var ok bool
sc, ok = k.(*http2Server)
if !ok {
Expand Down Expand Up @@ -493,7 +493,7 @@ func TestServerWithMisbehavedClient(t *testing.T) {
t.Fatalf("Failed to write data: %v", err)
}
cc.writableChan <- 0
sent += 1
sent++
}
// Server sent a resetStream for s already.
code := http2RSTErrConvTab[http2.ErrCodeFlowControl]
Expand Down

0 comments on commit 5700d19

Please sign in to comment.