From 1037bf7f69ba96345309be1dd961fc9570f22ffe Mon Sep 17 00:00:00 2001 From: Semir Patel Date: Fri, 28 Apr 2023 12:14:37 -0500 Subject: [PATCH] Sync .golangci.yml from ENT (#17180) --- .golangci.yml | 27 +++++-------------- .../grpc-external/services/resource/delete.go | 2 +- 2 files changed, 7 insertions(+), 22 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 21f5d8228d50..245f04d7a955 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -23,29 +23,14 @@ issues: # Temp Ignore SA9004: only the first constant in this group has an explicit type # https://staticcheck.io/docs/checks#SA9004 - linters: [staticcheck] - text: 'SA9004:' - - - linters: [staticcheck] - text: 'SA1019: "github.com/golang/protobuf/jsonpb" is deprecated: Use the "google.golang.org/protobuf/encoding/protojson" package instead.' - - - linters: [staticcheck] - text: 'SA1019: "github.com/golang/protobuf/proto" is deprecated: Use the "google.golang.org/protobuf/proto" package instead.' - - - linters: [staticcheck] - text: 'SA1019: ptypes.MarshalAny is deprecated' - - - linters: [staticcheck] - text: 'SA1019: ptypes.UnmarshalAny is deprecated' - - - linters: [staticcheck] - text: 'SA1019: "github.com/golang/protobuf/ptypes" is deprecated: Well-known types have specialized functionality directly injected into the generated packages for each message type. See the deprecation notice for each function for the suggested alternative.' + text: "SA9004:" - linters: [staticcheck] text: 'SA1019: "io/ioutil" has been deprecated since Go 1.16' # An argument that always receives the same value is often not a problem. - linters: [unparam] - text: 'always receives' + text: "always receives" # Often functions will implement an interface that returns an error without # needing to return an error. Sometimes the error return value is unnecessary @@ -59,18 +44,18 @@ issues: # self-documentation than a single underscore by itself. Underscore arguments # should generally only be used when a function is implementing an interface. - linters: [unparam] - text: '`_[^`]*` is unused' + text: "`_[^`]*` is unused" # Temp ignore some common unused parameters so that unparam can be added # incrementally. - linters: [unparam] - text: '`(t|resp|req|entMeta)` is unused' + text: "`(t|resp|req|entMeta)` is unused" # Temp ignore everything in _oss(_test).go and _ent(_test).go. Many of these # could use underscore to ignore the unused arguments, but the "always returns" # issue will likely remain in oss, and will need to be excluded. - linters: [unparam] - path: '(_oss.go|_oss_test.go|_ent.go|_ent_test.go)' + path: "(_oss.go|_oss_test.go|_ent.go|_ent_test.go)" linters-settings: govet: @@ -115,7 +100,7 @@ linters-settings: # Specify an error message to output when a denied package is used. # Default: [] packages-with-error-message: - - net/rpc: 'only use forked copy in github.com/hashicorp/consul-net-rpc/net/rpc' + - net/rpc: "only use forked copy in github.com/hashicorp/consul-net-rpc/net/rpc" run: timeout: 10m diff --git a/agent/grpc-external/services/resource/delete.go b/agent/grpc-external/services/resource/delete.go index a072dcee3cf9..f15fafa5931e 100644 --- a/agent/grpc-external/services/resource/delete.go +++ b/agent/grpc-external/services/resource/delete.go @@ -9,10 +9,10 @@ import ( "fmt" "time" - "github.com/golang/protobuf/proto" "github.com/oklog/ulid/v2" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + "google.golang.org/protobuf/proto" "google.golang.org/protobuf/types/known/anypb" "github.com/hashicorp/consul/acl"