From 968ee5814e25b4ef89cda3b1c3f2c0e0c984a506 Mon Sep 17 00:00:00 2001 From: wangxiaoer Date: Tue, 16 May 2023 16:41:49 +0800 Subject: [PATCH] replace with constant (#1445) --- check/test.go | 8 ++++---- cmd/util.go | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/check/test.go b/check/test.go index bb36623..2aee9b0 100644 --- a/check/test.go +++ b/check/test.go @@ -24,7 +24,7 @@ import ( "strings" "github.com/golang/glog" - yaml "gopkg.in/yaml.v2" + "gopkg.in/yaml.v2" "k8s.io/client-go/util/jsonpath" ) @@ -243,11 +243,11 @@ func (t testItem) evaluate(s string) *testOutput { isExist = "does not exist" } switch t.auditUsed { - case "auditCommand": + case AuditCommand: glog.V(3).Infof("Flag '%s' %s", t.Flag, isExist) - case "auditConfig": + case AuditConfig: glog.V(3).Infof("Path '%s' %s", t.Path, isExist) - case "auditEnv": + case AuditEnv: glog.V(3).Infof("Env '%s' %s", t.Env, isExist) default: glog.V(3).Infof("Error with identify audit used %s", t.auditUsed) diff --git a/cmd/util.go b/cmd/util.go index 59f20b1..d85d024 100644 --- a/cmd/util.go +++ b/cmd/util.go @@ -127,7 +127,7 @@ func getConfigFilePath(benchmarkVersion string, filename string) (path string, e glog.V(2).Info(fmt.Sprintf("Looking for config specific CIS version %q", benchmarkVersion)) path = filepath.Join(cfgDir, benchmarkVersion) - file := filepath.Join(path, string(filename)) + file := filepath.Join(path, filename) glog.V(2).Info(fmt.Sprintf("Looking for file: %s", file)) if _, err := os.Stat(file); err != nil {