Skip to content

Commit

Permalink
lint: Enable unconvert (#2368)
Browse files Browse the repository at this point in the history
unconvert removes unnecessary type conversions:
https://github.com/mdempsky/unconvert

Part of #217

Signed-off-by: Andrew Seigner <siggy@buoyant.io>
  • Loading branch information
siggy authored Feb 26, 2019
1 parent 25e4623 commit ad0d0b7
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
9 changes: 8 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# This file specifies which linters golangci-lint should run.
#
# For descriptions of all available linters, run:
# ./.golangci-lint-1.15.0 linters
# or browse to:
# https://github.com/golangci/golangci-lint#supported-linters

run:
deadline: 5m
issues:
Expand All @@ -17,6 +24,7 @@ linters:
- nakedret
- scopelint
- typecheck
- unconvert
- unused
- varcheck
# TODO: enable more linters!
Expand All @@ -30,7 +38,6 @@ linters:
# - maligned
# - prealloc
# - stylecheck
# - unconvert
# - unparam
disable:
- errcheck
Expand Down
2 changes: 1 addition & 1 deletion pkg/profiles/profiles.go
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ func ToRequestMatch(reqMatch *sp.RequestMatch) (*pb.RequestMatch, error) {
// - recursive fields
func Validate(data []byte) error {
var serviceProfile sp.ServiceProfile
err := yaml.UnmarshalStrict([]byte(data), &serviceProfile)
err := yaml.UnmarshalStrict(data, &serviceProfile)
if err != nil {
return fmt.Errorf("failed to validate ServiceProfile: %s", err)
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/profiles/tap_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ func TestTapToServiceProfile(t *testing.T) {
},
}

actualServiceProfile, err := tapToServiceProfile(mockAPIClient, tapReq, namespace, name, tapDuration, int(routeLimit))
actualServiceProfile, err := tapToServiceProfile(mockAPIClient, tapReq, namespace, name, tapDuration, routeLimit)
if err != nil {
t.Fatalf("Failed to create ServiceProfile: %v", err)
}
Expand Down

0 comments on commit ad0d0b7

Please sign in to comment.