#Enum default value
1 messages · Page 1 of 1 (latest)
Can you clarify what you mean? Or what you're trying to do? Enums can't have an empty value, and if an argument has a default value, then it's optional.
Yeah of course. I am trying to consume my enum from a module other than the one that's defined in. When I want to use the enum, I can't just pass in dag.MyEnum to the function because it's not allowed to be a required parameter. So I have to do something like dagger.MyModuleMyFunctionOpts{ MyEnum: dagger.MyEnum} instead of passing in function(dagger.MyEnum). I understand if this is a limitation of the current implementation but it's not documented. It took me a while to figure that out.
No, \\ +optional is supposed to work, with *dagger.MyEnum (pointer). Doesn’t it work?
optional works. Making it non-optional (required), does not work.
Required should also work, we have tests for that (iirc). Can you give a simple example of what you’re trying to do?
Sure! Let me try to put something together