mirror of
https://github.com/containers/podman.git
synced 2025-06-24 11:28:24 +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 {
|
func IsSimpleType(f reflect.Value) bool {
|
||||||
switch f.Interface().(type) {
|
if _, ok := f.Interface().(fmt.Stringer); ok {
|
||||||
case fmt.Stringer:
|
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -26,9 +25,8 @@ func IsSimpleType(f reflect.Value) bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func SimpleTypeToParam(f reflect.Value) string {
|
func SimpleTypeToParam(f reflect.Value) string {
|
||||||
switch cast := f.Interface().(type) {
|
if s, ok := f.Interface().(fmt.Stringer); ok {
|
||||||
case fmt.Stringer:
|
return s.String()
|
||||||
return cast.String()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
switch f.Kind() {
|
switch f.Kind() {
|
||||||
|
Reference in New Issue
Block a user