isNil gets whether the object is nil or not.
(object interface{})
| 189 | |
| 190 | // isNil gets whether the object is nil or not. |
| 191 | func isNil(object interface{}) bool { |
| 192 | if object == nil { |
| 193 | return true |
| 194 | } |
| 195 | value := reflect.ValueOf(object) |
| 196 | kind := value.Kind() |
| 197 | if kind >= reflect.Chan && kind <= reflect.Slice && value.IsNil() { |
| 198 | return true |
| 199 | } |
| 200 | return false |
| 201 | } |
| 202 | |
| 203 | // escapeFormatString escapes strings for use in formatted functions like Sprintf. |
| 204 | func escapeFormatString(fmt string) string { |
no test coverage detected