dereference returns the underlying value v points to.
(v reflect.Value)
| 182 | |
| 183 | // dereference returns the underlying value v points to. |
| 184 | func dereference(v reflect.Value) reflect.Value { |
| 185 | for v.Kind() == reflect.Ptr { |
| 186 | if v.IsNil() { |
| 187 | // initialize with a new value and continue searching |
| 188 | v.Set(reflect.New(v.Type().Elem())) |
| 189 | } |
| 190 | v = v.Elem() |
| 191 | } |
| 192 | return v |
| 193 | } |
| 194 | |
| 195 | func getCollectionByModelOrIdentifier(app App, collectionModelOrIdentifier any) (*Collection, error) { |
| 196 | switch c := collectionModelOrIdentifier.(type) { |
no test coverage detected
searching dependent graphs…