(val any)
| 226 | } |
| 227 | |
| 228 | func IsNil(val any) bool { |
| 229 | if val == nil { |
| 230 | return true |
| 231 | } |
| 232 | |
| 233 | v := reflect.ValueOf(val) |
| 234 | k := v.Kind() |
| 235 | switch k { |
| 236 | case reflect.Chan, reflect.Func, reflect.Map, reflect.Pointer, |
| 237 | reflect.UnsafePointer, reflect.Interface, reflect.Slice: |
| 238 | return v.IsNil() |
| 239 | default: |
| 240 | // Other types cannot be nil |
| 241 | } |
| 242 | |
| 243 | return false |
| 244 | } |
| 245 | |
| 246 | // Uniq returns a new slice with duplicate elements removed, preserving order. |
| 247 | func Uniq[T comparable](array []T) []T { |
no outgoing calls
no test coverage detected