diff --git a/check/test.go b/check/test.go index 2aee9b0b0..e27b34902 100644 --- a/check/test.go +++ b/check/test.go @@ -221,7 +221,7 @@ func (t testItem) evaluate(s string) *testOutput { match, value, err := t.findValue(s) if err != nil { - fmt.Fprintf(os.Stderr, err.Error()) + fmt.Fprint(os.Stderr, err.Error()) return failTestItem(err.Error()) } diff --git a/check/test_test.go b/check/test_test.go index 9da55a491..d786f0842 100644 --- a/check/test_test.go +++ b/check/test_test.go @@ -290,7 +290,7 @@ func TestTestExecute(t *testing.T) { c.check.AuditEnvOutput = c.strEnv res, err := c.check.execute() if err != nil { - t.Errorf(err.Error()) + t.Error(err.Error()) } if !res.testResult { t.Errorf("Test ID %v - expected:%v, got:%v", c.check.ID, true, res) @@ -334,7 +334,7 @@ func TestTestExecuteExceptions(t *testing.T) { c.Check.AuditConfigOutput = c.str res, err := c.Check.execute() if err != nil { - t.Errorf(err.Error()) + t.Error(err.Error()) } if res.testResult { t.Errorf("expected:%v, got:%v", false, res) diff --git a/cmd/run.go b/cmd/run.go index 8dd392275..2ece47a5d 100644 --- a/cmd/run.go +++ b/cmd/run.go @@ -47,7 +47,7 @@ var runCmd = &cobra.Command{ exitWithError(fmt.Errorf("error validating targets: %v", err)) } if len(targets) > 0 && !valid { - exitWithError(fmt.Errorf(fmt.Sprintf(`The specified --targets "%s" are not configured for the CIS Benchmark %s\n Valid targets %v`, strings.Join(targets, ","), bv, benchmarkVersionToTargetsMap[bv]))) + exitWithError(fmt.Errorf(`The specified --targets "%s" are not configured for the CIS Benchmark %s\n Valid targets %v`, strings.Join(targets, ","), bv, benchmarkVersionToTargetsMap[bv])) } // Merge version-specific config if any.