|
@@ -160,6 +160,13 @@ func (s Map) String(key, defaultVal string) string {
|
|
|
return defaultVal
|
|
|
}
|
|
|
|
|
|
+func (s Map) StringMust(key, defaultVal string) string {
|
|
|
+ if iface, check := s[key]; check {
|
|
|
+ return fmt.Sprint(iface)
|
|
|
+ }
|
|
|
+ return defaultVal
|
|
|
+}
|
|
|
+
|
|
|
func (s Map) StringWithError(key, defaultVal string) (string, error) {
|
|
|
if iface, check := s[key]; check {
|
|
|
val := val(iface, defaultVal).String()
|