Skip to content

Commit

Permalink
Fix readme (#26)
Browse files Browse the repository at this point in the history
fix readme
  • Loading branch information
alexpantyukhin authored Sep 20, 2019
1 parent 25c72c4 commit d5ee631
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ isMatched, _ := Match(val).
Result()
```


## With Maps:
```go
isMatched, mr := match.Match(map[string]int{
Expand Down Expand Up @@ -78,9 +77,13 @@ isMatched, mr := match.Match("gophergopher").
Result()
```

# Plans:
- [x] I would like to implement a recursive pattern matching (for matching inner elements of objects)
- [ ] Possibly to have matching without result.
## Without result:
```go
Match(val).
When(42, func() { fmt.Println("You found the answer to life, universe and everything!") }).
When(ANY, func() { fmt.Println("No.. It's not an answer.") }).
Result()
```

# Installation
Just `go get` this repository with the following way:
Expand Down
1 change: 1 addition & 0 deletions match_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ func TestMatch_Fibonacci(t *testing.T) {
func TestMatch_MatchWithoutResult(t *testing.T){
Match(10).
When(10, func() { assert.True(t, true) }).
When(ANY, func() { assert.False(t, true) }).
Result()
}

Expand Down

0 comments on commit d5ee631

Please sign in to comment.