Skip to content

Commit

Permalink
chore: unnecessary use of fmt.Sprintf (S1039) (aquasecurity#4637)
Browse files Browse the repository at this point in the history
  • Loading branch information
testwill committed Jun 15, 2023
1 parent bc9513f commit 1ce8bb5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
3 changes: 1 addition & 2 deletions pkg/compliance/spec/compliance_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package spec_test

import (
"fmt"
"sort"
"testing"

Expand Down Expand Up @@ -126,7 +125,7 @@ func TestComplianceSpec_Scanners(t *testing.T) {
Spec: tt.spec,
}
got, err := cs.Scanners()
if !tt.wantErr(t, err, fmt.Sprintf("Scanners()")) {
if !tt.wantErr(t, err, "Scanners()") {
return
}
sort.Slice(got, func(i, j int) bool {
Expand Down
12 changes: 6 additions & 6 deletions pkg/sbom/spdx/marshal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ func TestMarshaler_Marshal(t *testing.T) {
CreatorType: "Organization",
},
{
Creator: fmt.Sprintf("trivy-0.38.1"),
Creator: "trivy-0.38.1",
CreatorType: "Tool",
},
},
Expand Down Expand Up @@ -353,7 +353,7 @@ func TestMarshaler_Marshal(t *testing.T) {
CreatorType: "Organization",
},
{
Creator: fmt.Sprintf("trivy-0.38.1"),
Creator: "trivy-0.38.1",
CreatorType: "Tool",
},
},
Expand Down Expand Up @@ -554,7 +554,7 @@ func TestMarshaler_Marshal(t *testing.T) {
CreatorType: "Organization",
},
{
Creator: fmt.Sprintf("trivy-0.38.1"),
Creator: "trivy-0.38.1",
CreatorType: "Tool",
},
},
Expand Down Expand Up @@ -652,7 +652,7 @@ func TestMarshaler_Marshal(t *testing.T) {
CreatorType: "Organization",
},
{
Creator: fmt.Sprintf("trivy-0.38.1"),
Creator: "trivy-0.38.1",
CreatorType: "Tool",
},
},
Expand Down Expand Up @@ -748,7 +748,7 @@ func TestMarshaler_Marshal(t *testing.T) {
CreatorType: "Organization",
},
{
Creator: fmt.Sprintf("trivy-0.38.1"),
Creator: "trivy-0.38.1",
CreatorType: "Tool",
},
},
Expand Down Expand Up @@ -811,7 +811,7 @@ func TestMarshaler_Marshal(t *testing.T) {
CreatorType: "Organization",
},
{
Creator: fmt.Sprintf("trivy-0.38.1"),
Creator: "trivy-0.38.1",
CreatorType: "Tool",
},
},
Expand Down

0 comments on commit 1ce8bb5

Please sign in to comment.