You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to parse unstructured JSON. For example, a field that is either a string or []string. As a suggestion, I feel there is the need for IsString, IsArray, etc methods. These would theoretically allow checking the type of an AstNode in a performant way. Currently, I am using two techniques to accomplish this, both of which seem poor:
Call String or Array and check for errors
Call Interface, then use reflection to check the type
If an IsString, etc method would be no more performant than either of these techniques, feel free to ignore my suggestion.
The text was updated successfully, but these errors were encountered:
I'd like to parse unstructured JSON. For example, a field that is either a string or []string. As a suggestion, I feel there is the need for
IsString
,IsArray
, etc methods. These would theoretically allow checking the type of an AstNode in a performant way. Currently, I am using two techniques to accomplish this, both of which seem poor:String
orArray
and check for errorsInterface
, then use reflection to check the typeIf an
IsString
, etc method would be no more performant than either of these techniques, feel free to ignore my suggestion.The text was updated successfully, but these errors were encountered: