diff --git a/dump_region/main.go b/dump_region/main.go index 9fd0b29c..b0c7a258 100644 --- a/dump_region/main.go +++ b/dump_region/main.go @@ -56,7 +56,7 @@ type keyRange struct { func main() { flag.Parse() if *printVersion { - fmt.Printf(utils.GetRawInfo("dump_region")) + fmt.Println(utils.GetRawInfo("dump_region")) return } diff --git a/importer/config.go b/importer/config.go index 860c05ed..ee76a839 100644 --- a/importer/config.go +++ b/importer/config.go @@ -70,7 +70,7 @@ func (c *Config) Parse(arguments []string) error { } if c.printVersion { - fmt.Printf(utils.GetRawInfo("importer")) + fmt.Println(utils.GetRawInfo("importer")) return flag.ErrHelp } diff --git a/pkg/check/privilege.go b/pkg/check/privilege.go index ad670c1e..3ec9fb48 100644 --- a/pkg/check/privilege.go +++ b/pkg/check/privilege.go @@ -143,7 +143,11 @@ func verifyPrivileges(result *Result, grants []string, expectedGrants map[mysql. // get username and hostname node, err := parser.New().ParseOneStmt(grant, "", "") if err != nil { - result.Errors = append(result.Errors, NewError(errors.Annotatef(err, "grant %s, grant after replace %s", grants[i], grant).Error())) + result.Errors = append(result.Errors, + NewError("%s", + errors.Annotatef(err, "grant %s, grant after replace %s", grants[i], grant).Error(), + ), + ) return } grantStmt, ok := node.(*ast.GrantStmt) diff --git a/pkg/check/table_structure.go b/pkg/check/table_structure.go index bccf77e4..0b9907c4 100644 --- a/pkg/check/table_structure.go +++ b/pkg/check/table_structure.go @@ -127,13 +127,13 @@ func (c *TablesChecker) Check(ctx context.Context) *Result { if len(r.State) == 0 { r.State = StateWarning } - e := NewError(tableMsg + option.errMessage) + e := NewError("%s", tableMsg+option.errMessage) e.Severity = StateWarning e.Instruction = option.instruction r.Errors = append(r.Errors, e) case StateFailure: r.State = StateFailure - e := NewError(tableMsg + option.errMessage) + e := NewError("%s", tableMsg+option.errMessage) e.Instruction = option.instruction r.Errors = append(r.Errors, e) }