Use the Type field to determine which variant is active, then access the corresponding field:
switch inputUnion.Type { case operations.InputUnionTypeStr: // inputUnion.Str is populated case operations.InputUnionTypeArrayOfStr: // inputUnion.ArrayOfStr is populated case operations.InputUnionTypeArrayOfNumber: // inputUnion.ArrayOfNumber is populated case operations.InputUnionTypeArrayOfArrayOfNumber: // inputUnion.ArrayOfArrayOfNumber is populated case operations.InputUnionTypeArrayOfInput: // inputUnion.ArrayOfInput is populated}
⌘I
Assistant
Responses are generated using AI and may contain mistakes.