Skip to content

Commit daf9843

Browse files
committed
Update README.md
1 parent 6e1e72c commit daf9843

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ var expressions = []string{
8282
"bar.Value in ['a', 'b', 'c']",
8383
"name matches '^hello.+$'",
8484
"now().Sub(startedAt).String()",
85-
"all(tweets, {.Size <= 280}) ? '👍' : '👎'",
85+
"all(tweets, {len(.Message) <= 280}) ? '👍' : '👎'",
8686
}
8787

8888
var environment = map[string]interface{}{
@@ -91,12 +91,11 @@ var environment = map[string]interface{}{
9191
"name": "hello world",
9292
"startedAt": time.Now(),
9393
"now": func() time.Time { return time.Now() },
94-
"tweets": []tweet{},
94+
"tweets": []tweet{{"first tweet"}},
9595
}
9696

9797
type tweet struct {
9898
Message string
99-
Size int
10099
}
101100

102101
func main() {
@@ -114,7 +113,6 @@ func main() {
114113
fmt.Println(output)
115114
}
116115
}
117-
118116
```
119117

120118
## Contributing

docs/examples/demo.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ var expressions = []string{
1212
"bar.Value in ['a', 'b', 'c']",
1313
"name matches '^hello.+$'",
1414
"now().Sub(startedAt).String()",
15-
"all(tweets, {.Size <= 280}) ? '👍' : '👎'",
15+
"all(tweets, {len(.Message) <= 280}) ? '👍' : '👎'",
1616
}
1717

1818
var environment = map[string]interface{}{
@@ -21,12 +21,11 @@ var environment = map[string]interface{}{
2121
"name": "hello world",
2222
"startedAt": time.Now(),
2323
"now": func() time.Time { return time.Now() },
24-
"tweets": []tweet{},
24+
"tweets": []tweet{{"first tweet"}},
2525
}
2626

2727
type tweet struct {
2828
Message string
29-
Size int
3029
}
3130

3231
func main() {

0 commit comments

Comments
 (0)