Fix govet+staticcheck issues (#20263)

This is better: https://github.com/golang/go/issues/60529
This commit is contained in:
Klaus Post
2024-08-14 10:11:51 -07:00
committed by GitHub
parent 51b1f41518
commit 3ffeabdfcb
16 changed files with 49 additions and 37 deletions
+13 -2
View File
@@ -58,9 +58,20 @@ func (u Err) Error() string {
}
// Msg - Replace the current error's message
func (u Err) Msg(m string, args ...interface{}) Err {
func (u Err) Msg(m string) Err {
e := u.Clone()
e.msg = fmt.Sprintf(m, args...)
e.msg = m
return e
}
// Msgf - Replace the current error's message
func (u Err) Msgf(m string, args ...interface{}) Err {
e := u.Clone()
if len(args) == 0 {
e.msg = m
} else {
e.msg = fmt.Sprintf(m, args...)
}
return e
}