Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
bhmj authored Oct 14, 2022
1 parent 8440055 commit 2f0f4ee
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,7 @@ Expression examples:
```Go
// simple expression evaluation (error handling skipped)
result, _ := xpression.Eval([]byte(`5 - 3 * (6-12)`))
switch result.Type {
case xpression.NumberOperand:
fmt.Println(result.Number)
default:
fmt.Println("unexpected result")
}
fmt.Println(result.String())
// external data in expression (aka variables)
foobar := 123
Expand All @@ -53,7 +48,7 @@ Expression examples:
return nil
}
result, _ = xpression.EvalVar([]byte(`27 / foobar`), varFunc)
fmt.Println(result.Number)
fmt.Println(result.String())
```
[Run in Go Playground](https://play.golang.com/p/hCRHrEOYQ5p)

Expand Down

0 comments on commit 2f0f4ee

Please sign in to comment.