Skip to content

Commit

Permalink
Replace golangci with staticcheck
Browse files Browse the repository at this point in the history
  • Loading branch information
johanbrandhorst committed Mar 23, 2024
1 parent be89844 commit a4004b7
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 24 deletions.
12 changes: 7 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,15 +117,17 @@ jobs:
- run: PATH=$PATH:~/go/bin buf lint
- run: PATH=$PATH:~/go/bin buf format -w && git diff --exit-code
- run: PATH=$PATH:~/go/bin buf breaking --path protoc-gen-openapiv2/ --against 'https://github.com/grpc-ecosystem/grpc-gateway.git#branch=main'
golangci:
permissions:
pull-requests: read # for golangci/golangci-lint-action to fetch pull requests
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- uses: golangci/golangci-lint-action@3cfe3a4abbb849e10058ce4af15d205b6da42804 # v4
- uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5
with:
go-version: 1.22
check-latest: true
- uses: dominikh/staticcheck-action@v1.3.0
with:
version: v1.54.2
install-go: false
fuzz:
runs-on: ubuntu-latest
steps:
Expand Down
16 changes: 0 additions & 16 deletions .golangci.yml

This file was deleted.

2 changes: 1 addition & 1 deletion protoc-gen-openapiv2/internal/genopenapi/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -1331,7 +1331,7 @@ func renderServices(services []*descriptor.Service, paths *openapiPathsObject, r
// "NOTE: the referred field must be present at the top-level of the request message type."
// Ref: https://github.com/googleapis/googleapis/blob/b3397f5febbf21dfc69b875ddabaf76bee765058/google/api/http.proto#L350-L352
if len(b.Body.FieldPath) > 1 {
return fmt.Errorf("Body of request %q is not a top level field: '%v'.", meth.Service.GetName(), b.Body.FieldPath)
return fmt.Errorf("body of request %q is not a top level field: '%v'", meth.Service.GetName(), b.Body.FieldPath)
}
bodyField := b.Body.FieldPath[0]
if reg.GetUseJSONNamesForFields() {
Expand Down
1 change: 0 additions & 1 deletion runtime/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,6 @@ func annotateContext(ctx context.Context, mux *ServeMux, req *http.Request, rpcM
}

if timeout != 0 {
//nolint:govet // The context outlives this function
ctx, _ = context.WithTimeout(ctx, timeout)
}
if len(pairs) == 0 {
Expand Down
1 change: 0 additions & 1 deletion runtime/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import (

// ForwardResponseStream forwards the stream from gRPC server to REST client.
func ForwardResponseStream(ctx context.Context, mux *ServeMux, marshaler Marshaler, w http.ResponseWriter, req *http.Request, recv func() (proto.Message, error), opts ...func(context.Context, http.ResponseWriter, proto.Message) error) {
// nolint: bodyclose
rc := http.NewResponseController(w)
md, ok := ServerMetadataFromContext(ctx)
if !ok {
Expand Down

0 comments on commit a4004b7

Please sign in to comment.