Fixed a compilation error - there is not member named timestamp. Added some formatting for better looks. (#355)

This commit is contained in:
Pranav Peshwe
2023-04-19 12:57:56 +02:00
committed by GitHub
parent 2b8c157625
commit ac6fef86a1
+1 -1
View File
@@ -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{}))