Skip to content

Commit dbeadde

Browse files
authored
Add new line and fix test to avoid having to change version twice (#387)
1 parent 1d78bbb commit dbeadde

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

cmd/osv-scanner/main_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,11 +117,11 @@ func TestRun(t *testing.T) {
117117
name: "",
118118
args: []string{"", "--version"},
119119
wantExitCode: 0,
120-
wantStdout: `
121-
osv-scanner version: 1.3.3
120+
wantStdout: fmt.Sprintf(`
121+
osv-scanner version: %s
122122
commit: n/a
123123
built at: n/a
124-
`,
124+
`, version),
125125
wantStderr: "",
126126
},
127127
// one specific supported lockfile

pkg/reporter/table_reporter.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ func (r *TableReporter) PrintText(msg string) {
3939

4040
func (r *TableReporter) PrintResult(vulnResult *models.VulnerabilityResults) error {
4141
if len(vulnResult.Results) == 0 && !r.hasPrintedError {
42-
fmt.Fprintf(r.stdout, "No vulnerabilities found")
42+
fmt.Fprintf(r.stdout, "No vulnerabilities found\n")
4343
return nil
4444
}
4545

0 commit comments

Comments
 (0)