Skip to content

Commit

Permalink
Fix non-constant format strings (#824)
Browse files Browse the repository at this point in the history
ref #813
  • Loading branch information
dveeden authored Nov 26, 2024
1 parent d28498c commit a7f18fe
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion dump_region/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
2 changes: 1 addition & 1 deletion importer/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
6 changes: 5 additions & 1 deletion pkg/check/privilege.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions pkg/check/table_structure.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit a7f18fe

Please sign in to comment.