Skip to content

Commit

Permalink
Enable Lint Rule: redefines-builtin-id
Browse files Browse the repository at this point in the history
Signed-off-by: ZXYxc <[email protected]>
  • Loading branch information
ZXYxc committed Aug 15, 2024
1 parent 4595cfe commit a73dab4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
3 changes: 0 additions & 3 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -211,9 +211,6 @@ linters-settings:
# this is idiocy, promotes less readable code. Don't enable.
- name: var-declaration
disabled: true
# enable after cleanup
- name: redefines-builtin-id
disabled: true
# "no nested structs are allowed" - don't enable, doesn't make sense
- name: nested-structs
disabled: true
Expand Down
6 changes: 3 additions & 3 deletions cmd/agent/app/configmanager/grpc/manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
"github.com/jaegertracing/jaeger/proto-gen/api_v2"
)

func close(t *testing.T, c io.Closer) {
func closeTestGrpcConn(t *testing.T, c io.Closer) {
require.NoError(t, c.Close())
}

Expand All @@ -27,7 +27,7 @@ func TestSamplingManager_GetSamplingStrategy(t *testing.T) {
api_v2.RegisterSamplingManagerServer(s, &mockSamplingHandler{})
})
conn, err := grpc.NewClient(addr.String(), grpc.WithTransportCredentials(insecure.NewCredentials()))
defer close(t, conn)
defer closeTestGrpcConn(t, conn)
require.NoError(t, err)
defer s.GracefulStop()
manager := NewConfigManager(conn)
Expand All @@ -38,7 +38,7 @@ func TestSamplingManager_GetSamplingStrategy(t *testing.T) {

func TestSamplingManager_GetSamplingStrategy_error(t *testing.T) {
conn, err := grpc.NewClient("foo", grpc.WithTransportCredentials(insecure.NewCredentials()))
defer close(t, conn)
defer closeTestGrpcConn(t, conn)
require.NoError(t, err)
manager := NewConfigManager(conn)
resp, err := manager.GetSamplingStrategy(context.Background(), "any")
Expand Down
6 changes: 3 additions & 3 deletions plugin/sampling/strategyprovider/static/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ func deepCopy(s *api_v2.SamplingStrategyResponse) *api_v2.SamplingStrategyRespon
enc := gob.NewEncoder(&buf)
dec := gob.NewDecoder(&buf)
enc.Encode(*s)
var copy api_v2.SamplingStrategyResponse
dec.Decode(&copy)
return &copy
var copyValue api_v2.SamplingStrategyResponse
dec.Decode(&copyValue)
return &copyValue
}

0 comments on commit a73dab4

Please sign in to comment.