mirror of
https://github.com/containers/podman.git
synced 2025-06-24 03:08:13 +08:00
Don't switch on a single case
Signed-off-by: Nikolay Edigaryev <edigaryev@gmail.com>
This commit is contained in:
@ -12,8 +12,7 @@ import (
|
||||
)
|
||||
|
||||
func IsSimpleType(f reflect.Value) bool {
|
||||
switch f.Interface().(type) {
|
||||
case fmt.Stringer:
|
||||
if _, ok := f.Interface().(fmt.Stringer); ok {
|
||||
return true
|
||||
}
|
||||
|
||||
@ -26,9 +25,8 @@ func IsSimpleType(f reflect.Value) bool {
|
||||
}
|
||||
|
||||
func SimpleTypeToParam(f reflect.Value) string {
|
||||
switch cast := f.Interface().(type) {
|
||||
case fmt.Stringer:
|
||||
return cast.String()
|
||||
if s, ok := f.Interface().(fmt.Stringer); ok {
|
||||
return s.String()
|
||||
}
|
||||
|
||||
switch f.Kind() {
|
||||
|
Reference in New Issue
Block a user