IsNil returns true if the given field is nil value.
()
| 59 | |
| 60 | // IsNil returns true if the given field is nil value. |
| 61 | func (f *Field) IsNil() bool { |
| 62 | v := f.Value() |
| 63 | if v == nil || (reflect.ValueOf(v)).Kind() == reflect.Ptr && reflect.ValueOf(v).IsNil() { |
| 64 | return true |
| 65 | } |
| 66 | |
| 67 | return false |
| 68 | } |
| 69 | |
| 70 | // Name returns the name of the given field |
| 71 | // Play: https://go.dev/play/p/zfIGlqsatee |
no test coverage detected