-
-
Notifications
You must be signed in to change notification settings - Fork 475
Closed
Description
For example:
import (
someapi "xxxx"
)
type SomeStruct struct {
Type someapi.SomeType
}The expression I want to execute is to validate the value of an enumeration.
someStruct.Type == someapi.SomeType_TypeOne
errors encountered:
failed: unknown name someapi
This error is easy to understand, but I don't know how to import the "someapi" package into expr context.
I tried to convert the type to int32, but it didn't work
int32(someStruct.Type.Number())==1
failed: unknown func int32
The only solution I've found so far is to convert to string
someStruct.Type.String()=="Day"
This looks more expensive, so I want to seek the best practice.
Metadata
Metadata
Assignees
Labels
No labels