Use the Type field to determine which variant is active, then access the corresponding field:
switch container.Type { case components.ContainerUnionTypeStr: // container.Str is populated case components.ContainerUnionTypeContainerAuto: // container.ContainerAuto is populated}
⌘I
Assistant
Responses are generated using AI and may contain mistakes.