fix readme

This commit is contained in:
Александр Кирюхин 2022-06-13 04:34:40 +03:00
parent 0562659220
commit f20643d198
No known key found for this signature in database
GPG key ID: 6DF7A2910D0699E9

View file

@ -9,6 +9,8 @@ This library can evaluate any types of expressions: math expression, logic expre
## Usage ## Usage
Full example: [/example/main.go](/example/main.go)
```go ```go
ctx := context.Background() ctx := context.Background()
l := lexpr.New(lexpr.WithDefaults()) l := lexpr.New(lexpr.WithDefaults())
@ -83,7 +85,7 @@ result52, err := l.OneResult(ctx, `10 >= 5 || 10 <= 5`)
if err != nil { if err != nil {
log.Fatal(err) log.Fatal(err)
} }
log.Println("Result 5-2:", result52) // Output: 1 log.Println("Result 5-2:", result52) // Output: 0
result53, err := l.OneResult(ctx, `10 >= 5 && 10 <= 5`) result53, err := l.OneResult(ctx, `10 >= 5 && 10 <= 5`)
if err != nil { if err != nil {
log.Fatal(err) log.Fatal(err)