assertNotNil panic if the given value is nil. This function is used to validate that input with pointer type are not nil. See https://github.com/dagger/dagger/issues/5696 for more context.
(argName string, value any)
| 41 | // This function is used to validate that input with pointer type are not nil. |
| 42 | // See https://github.com/dagger/dagger/issues/5696 for more context. |
| 43 | func assertNotNil(argName string, value any) { |
| 44 | // We use reflect because just comparing value to nil is not working since |
| 45 | // the value is wrapped into a type when passed as parameter. |
| 46 | // E.g., nil become (*dagger.File)(nil). |
| 47 | if reflect.ValueOf(value).IsNil() { |
| 48 | panic(fmt.Sprintf("unexpected nil pointer for argument %q", argName)) |
| 49 | } |
| 50 | } |
| 51 | |
| 52 | type DaggerObject interface { |
| 53 | querybuilder.GraphQLMarshaller |
no outgoing calls
no test coverage detected