GetString returns the property corresponding to the provided key as a string, or the defaultVal if the key is not found.
(key, defaultVal string)
| 113 | // provided key as a string, or the defaultVal if the |
| 114 | // key is not found. |
| 115 | func (o Object) GetString(key, defaultVal string) string { |
| 116 | value := o.GetNode(key) |
| 117 | if value == nil || value.Type() != "string" { |
| 118 | return defaultVal |
| 119 | } |
| 120 | return value.RawString() |
| 121 | } |
| 122 | |
| 123 | // GetStringI is like GetString, but the key is case-insensitive |
| 124 | func (o Object) GetStringI(key, defaultVal string) string { |
no test coverage detected