style(config/value): optimize atomicValue format string (#2401)

pull/2408/head
Gaffey 2 years ago committed by GitHub
parent b10e067fe9
commit faa3adc300
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      config/value.go

@ -144,10 +144,8 @@ func (v *atomicValue) String() (string, error) {
return fmt.Sprint(val), nil
case []byte:
return string(val), nil
default:
if s, ok := val.(fmt.Stringer); ok {
return s.String(), nil
}
case fmt.Stringer:
return val.String(), nil
}
return "", fmt.Errorf("type assert to %v failed", reflect.TypeOf(v.Load()))
}

Loading…
Cancel
Save