Skip to content

Commit

Permalink
Fix lint warn
Browse files Browse the repository at this point in the history
  • Loading branch information
k1LoW committed Dec 13, 2024
1 parent 5569352 commit d7e76e7
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions testutil/grpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,23 +116,35 @@ func GRPCServer(t *testing.T, useTLS bool, disableReflection bool) *grpcstub.Ser
if !ok {
return false
}
return n.(string) == "alice"
str, ok := n.(string)

Check failure on line 119 in testutil/grpc.go

View workflow job for this annotation

GitHub Actions / Lint

[gostyle.repetition] The compiler always knows the type of a variable, and in most cases it is also clear to the reader what type a variable is by how it is used. It is only necessary to clarify the type of a variable if its value appears twice in the same scope. (ref: https://google.github.io/styleguide/go/decisions#variable-name-vs-type ): str<-[str]->string

Check failure on line 119 in testutil/grpc.go

View workflow job for this annotation

GitHub Actions / Lint

[gostyle.repetition] The compiler always knows the type of a variable, and in most cases it is also clear to the reader what type a variable is by how it is used. It is only necessary to clarify the type of a variable if its value appears twice in the same scope. (ref: https://google.github.io/styleguide/go/decisions#variable-name-vs-type ): str<-[str]->string

Check failure on line 119 in testutil/grpc.go

View workflow job for this annotation

GitHub Actions / gostyle

[gostyle] testutil/grpc.go#L119

[gostyle.repetition] The compiler always knows the type of a variable, and in most cases it is also clear to the reader what type a variable is by how it is used. It is only necessary to clarify the type of a variable if its value appears twice in the same scope. (ref: https://google.github.io/styleguide/go/decisions#variable-name-vs-type ): str<-[str]->string
Raw output
testutil/grpc.go:119:3: [gostyle.repetition] The compiler always knows the type of a variable, and in most cases it is also clear to the reader what type a variable is by how it is used. It is only necessary to clarify the type of a variable if its value appears twice in the same scope. (ref: https://google.github.io/styleguide/go/decisions#variable-name-vs-type ): str<-[str]->string
if !ok {
return false
}
return str == "alice"
}).Header("hellochat", "header").Trailer("hellochat", "trailer").
ResponseString(`{"message":"hello", "num":34, "create_time":"2022-06-25T05:24:46.382783Z"}`)
ts.Method("grpctest.GrpcTestService/HelloChat").Match(func(r *grpcstub.Request) bool {
n, ok := r.Message["name"]
if !ok {
return false
}
return n.(string) == "bob"
str, ok := n.(string)

Check failure on line 131 in testutil/grpc.go

View workflow job for this annotation

GitHub Actions / Lint

[gostyle.repetition] The compiler always knows the type of a variable, and in most cases it is also clear to the reader what type a variable is by how it is used. It is only necessary to clarify the type of a variable if its value appears twice in the same scope. (ref: https://google.github.io/styleguide/go/decisions#variable-name-vs-type ): str<-[str]->string

Check failure on line 131 in testutil/grpc.go

View workflow job for this annotation

GitHub Actions / Lint

[gostyle.repetition] The compiler always knows the type of a variable, and in most cases it is also clear to the reader what type a variable is by how it is used. It is only necessary to clarify the type of a variable if its value appears twice in the same scope. (ref: https://google.github.io/styleguide/go/decisions#variable-name-vs-type ): str<-[str]->string

Check failure on line 131 in testutil/grpc.go

View workflow job for this annotation

GitHub Actions / gostyle

[gostyle] testutil/grpc.go#L131

[gostyle.repetition] The compiler always knows the type of a variable, and in most cases it is also clear to the reader what type a variable is by how it is used. It is only necessary to clarify the type of a variable if its value appears twice in the same scope. (ref: https://google.github.io/styleguide/go/decisions#variable-name-vs-type ): str<-[str]->string
Raw output
testutil/grpc.go:131:3: [gostyle.repetition] The compiler always knows the type of a variable, and in most cases it is also clear to the reader what type a variable is by how it is used. It is only necessary to clarify the type of a variable if its value appears twice in the same scope. (ref: https://google.github.io/styleguide/go/decisions#variable-name-vs-type ): str<-[str]->string
if !ok {
return false
}
return str == "bob"
}).Header("hellochat-second", "header").Trailer("hellochat-second", "trailer").
ResponseString(`{"message":"hello", "num":35, "create_time":"2022-06-25T05:24:47.382783Z"}`)
ts.Method("grpctest.GrpcTestService/HelloChat").Match(func(r *grpcstub.Request) bool {
n, ok := r.Message["name"]
if !ok {
return false
}
return n.(string) == "charlie"
str, ok := n.(string)

Check failure on line 143 in testutil/grpc.go

View workflow job for this annotation

GitHub Actions / Lint

[gostyle.repetition] The compiler always knows the type of a variable, and in most cases it is also clear to the reader what type a variable is by how it is used. It is only necessary to clarify the type of a variable if its value appears twice in the same scope. (ref: https://google.github.io/styleguide/go/decisions#variable-name-vs-type ): str<-[str]->string

Check failure on line 143 in testutil/grpc.go

View workflow job for this annotation

GitHub Actions / Lint

[gostyle.repetition] The compiler always knows the type of a variable, and in most cases it is also clear to the reader what type a variable is by how it is used. It is only necessary to clarify the type of a variable if its value appears twice in the same scope. (ref: https://google.github.io/styleguide/go/decisions#variable-name-vs-type ): str<-[str]->string

Check failure on line 143 in testutil/grpc.go

View workflow job for this annotation

GitHub Actions / gostyle

[gostyle] testutil/grpc.go#L143

[gostyle.repetition] The compiler always knows the type of a variable, and in most cases it is also clear to the reader what type a variable is by how it is used. It is only necessary to clarify the type of a variable if its value appears twice in the same scope. (ref: https://google.github.io/styleguide/go/decisions#variable-name-vs-type ): str<-[str]->string
Raw output
testutil/grpc.go:143:3: [gostyle.repetition] The compiler always knows the type of a variable, and in most cases it is also clear to the reader what type a variable is by how it is used. It is only necessary to clarify the type of a variable if its value appears twice in the same scope. (ref: https://google.github.io/styleguide/go/decisions#variable-name-vs-type ): str<-[str]->string
if !ok {
return false
}
return str == "charlie"
}).Header("hellochat-third", "header").Trailer("hellochat-second", "trailer").
ResponseString(`{"message":"hello", "num":36, "create_time":"2022-06-25T05:24:48.382783Z"}`)
ts.Method("grpctest.GrpcTestService/HelloFields").Match(func(r *grpcstub.Request) bool { return true }).
Expand Down

0 comments on commit d7e76e7

Please sign in to comment.