chore: remove redundant prefix of "error: " in error creation

qiying.wang 2 years ago committed by kevin
parent 7a327ccda4
commit fe13a533f5

@ -213,23 +213,23 @@ func (s *Set) validate(i interface{}) {
switch i.(type) {
case int:
if s.tp != intType {
logx.Errorf("Error: element is int, but set contains elements with type %d", s.tp)
logx.Errorf("element is int, but set contains elements with type %d", s.tp)
}
case int64:
if s.tp != int64Type {
logx.Errorf("Error: element is int64, but set contains elements with type %d", s.tp)
logx.Errorf("element is int64, but set contains elements with type %d", s.tp)
}
case uint:
if s.tp != uintType {
logx.Errorf("Error: element is uint, but set contains elements with type %d", s.tp)
logx.Errorf("element is uint, but set contains elements with type %d", s.tp)
}
case uint64:
if s.tp != uint64Type {
logx.Errorf("Error: element is uint64, but set contains elements with type %d", s.tp)
logx.Errorf("element is uint64, but set contains elements with type %d", s.tp)
}
case string:
if s.tp != stringType {
logx.Errorf("Error: element is string, but set contains elements with type %d", s.tp)
logx.Errorf("element is string, but set contains elements with type %d", s.tp)
}
}
}

@ -1009,7 +1009,7 @@ func newInitError(name string) error {
}
func newTypeMismatchError(name string) error {
return fmt.Errorf("error: type mismatch for field %s", name)
return fmt.Errorf("type mismatch for field %s", name)
}
func readKeys(key string) []string {

@ -66,7 +66,7 @@ func format(query string, args ...interface{}) (string, error) {
switch ch {
case '?':
if argIndex >= numArgs {
return "", fmt.Errorf("error: %d ? in sql, but less arguments provided", argIndex)
return "", fmt.Errorf("%d ? in sql, but less arguments provided", argIndex)
}
writeValue(&b, args[argIndex])
@ -93,7 +93,7 @@ func format(query string, args ...interface{}) (string, error) {
index--
if index < 0 || numArgs <= index {
return "", fmt.Errorf("error: wrong index %d in sql", index)
return "", fmt.Errorf("wrong index %d in sql", index)
}
writeValue(&b, args[index])
@ -124,7 +124,7 @@ func format(query string, args ...interface{}) (string, error) {
}
if argIndex < numArgs {
return "", fmt.Errorf("error: %d arguments provided, not matching sql", argIndex)
return "", fmt.Errorf("%d arguments provided, not matching sql", argIndex)
}
return b.String(), nil

@ -53,7 +53,7 @@ func format(query string, args ...interface{}) (string, error) {
for _, ch := range query {
if ch == '?' {
if argIndex >= numArgs {
return "", fmt.Errorf("error: %d ? in sql, but less arguments provided", argIndex)
return "", fmt.Errorf("%d ? in sql, but less arguments provided", argIndex)
}
arg := args[argIndex]
@ -79,7 +79,7 @@ func format(query string, args ...interface{}) (string, error) {
}
if argIndex < numArgs {
return "", fmt.Errorf("error: %d ? in sql, but more arguments provided", argIndex)
return "", fmt.Errorf("%d ? in sql, but more arguments provided", argIndex)
}
return b.String(), nil

Loading…
Cancel
Save