fix(admin): read int values from YAML for port fields
This commit is contained in:
parent
64ddd71358
commit
9edd6f1038
1 changed files with 10 additions and 2 deletions
|
|
@ -1,6 +1,7 @@
|
||||||
package admin
|
package admin
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
|
|
@ -132,8 +133,15 @@ func getNested(m map[string]interface{}, keys ...string) string {
|
||||||
}
|
}
|
||||||
v = mp[k]
|
v = mp[k]
|
||||||
if i == len(keys)-1 {
|
if i == len(keys)-1 {
|
||||||
s, _ := v.(string)
|
switch val := v.(type) {
|
||||||
return s
|
case string:
|
||||||
|
return val
|
||||||
|
case int:
|
||||||
|
return fmt.Sprintf("%d", val)
|
||||||
|
case float64:
|
||||||
|
return fmt.Sprintf("%.0f", val)
|
||||||
|
}
|
||||||
|
return ""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return ""
|
return ""
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue