expr icon indicating copy to clipboard operation
expr copied to clipboard

Support fetch using interface

Open zsh1995 opened this issue 4 years ago • 0 comments

Hi! Is it possible to provide a Getter interface for fetch ops?


type Getter interface {
    Get(key string) (interface{}, bool)
}
Env = map[string]interface{}{
    "ctx": getter,
}

Then expression can be more simple

ctx.value_want_to_get 

instead of using function

get_value("value_want_to_get")

zsh1995 avatar Jun 22 '21 08:06 zsh1995