Skip to content

Commit cc46349

Browse files
authored
feat: update to Go v1.24 (#315)
* feat: upgrade to Go v1.24 * refactor: make `govet` happy
1 parent d80b706 commit cc46349

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/g-rath/osv-detector
22

3-
go 1.23.8
3+
go 1.24.6
44

55
require (
66
github.com/BurntSushi/toml v1.5.0

internal/reporter/reporter_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ func TestReporter_PrintError(t *testing.T) {
4747
stderr := &bytes.Buffer{}
4848
r := reporter.New(stdout, stderr, false)
4949

50-
r.PrintErrorf(msg)
50+
r.PrintErrorf("%s", msg)
5151

5252
if gotStdout := stdout.String(); gotStdout != "" {
5353
t.Errorf("Expected stdout to be empty, but got \"%s\"", gotStdout)
@@ -177,7 +177,7 @@ func TestReporter_PrintText(t *testing.T) {
177177
stderr := &bytes.Buffer{}
178178

179179
r := reporter.New(stdout, stderr, tt.args.outputAsJSON)
180-
r.PrintTextf(tt.args.msg)
180+
r.PrintTextf("%s", tt.args.msg)
181181

182182
if gotStdout := stdout.String(); gotStdout != tt.wantedStdout {
183183
t.Errorf("stdout got = %s, want %s", gotStdout, tt.wantedStdout)

main.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ func (dbs OSVDatabases) check(r *reporter.Reporter, lockf lockfile.Lockfile, ign
8888
results, err := db.Check(lockf.Packages)
8989

9090
if err != nil {
91-
r.PrintErrorf(color.RedString(fmt.Sprintf(
91+
r.PrintErrorf("%s", color.RedString(fmt.Sprintf(
9292
" an api error occurred while trying to check the packages listed in %s: %v\n",
9393
lockf.FilePath,
9494
err,
@@ -755,9 +755,9 @@ func writeUpdatedConfigs(r *reporter.Reporter, vulnsPerConfig map[string]map[str
755755

756756
for _, line := range lines {
757757
if strings.HasPrefix(line, "Error updating") {
758-
r.PrintErrorf(line)
758+
r.PrintErrorf("%s", line)
759759
} else {
760-
r.PrintTextf(line)
760+
r.PrintTextf("%s", line)
761761
}
762762
}
763763
}

0 commit comments

Comments
 (0)