Replies: 1 comment 2 replies
-
|
Expr Playground uses a new types package in Expr: https://pkg.go.dev/github.com/expr-lang/expr@v1.17.7/types With this package you can define types with more strict guidance: strictMap := types.Map{
"foo": types.Int,
"bar": types.TypeOf(myStruct).
}And if you want to define a map which also contains additional (or default keys): types.Map{
"foo": types.Int,
"bar": types.TypeOf(myStruct).
types.Extra: types.Any,
}I will add a documentation about new types packages. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I was wondering how the playground has been implemented to allow for strict compiling, specifically how you are generating the types from the JSON? We are looking to emulate this to verify rules produced by business users that are consumed by our rules engine, potentially reusable in a CI pipeline.
Beta Was this translation helpful? Give feedback.
All reactions