expr
expr copied to clipboard
Add support for tags `expr:"..."`
Add support for tags expr:"..."
for names aliases.
type Env struct {
Value int `expr:"value"`
}
And now it's will be possible to use value
instead of Value
in expressions.
I quite like this. Why was this closed?
Let’s reopen this ;)
To piggyback on this enhancement I need to support sloppy expressions, so ideally I need to support "Value", "value", "VALUE", etc. as mapping to the Value
field.
type Env struct {
Value int `expr:"value, VALUE, Value"`
}
And/or
type Env struct {
Value int `expr:"case-insensitive"`
}
I guess both would have their place, some implementations need only support specific field names, while other need to support any case insensitive variation.
If you want case insensitive expressions, use ast.Parse for it.