mirror of
https://github.com/hanzoai/expr.git
synced 2026-09-24 16:58:58 +00:00
Fixed a compilation error - there is not member named timestamp. Added some formatting for better looks. (#355)
This commit is contained in:
@@ -82,7 +82,7 @@ type Message struct {
|
||||
}
|
||||
|
||||
func main() {
|
||||
code := `map(filter(messages, len(.Text) > 0), .Text + Format(.timestamp))`
|
||||
code := `map(filter(messages, len(.Text) > 0), Format(.Date) + '\t' + .Text + '\n')`
|
||||
|
||||
// We can use an empty instance of the struct as an environment.
|
||||
program, err := expr.Compile(code, expr.Env(Env{}))
|
||||
|
||||
Reference in New Issue
Block a user