Skip to content

Commit

Permalink
fix wrong examples of Clamp function
Browse files Browse the repository at this point in the history
  • Loading branch information
Muhan Li authored Apr 22, 2022
1 parent dff318b commit 1ede5e1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -748,13 +748,13 @@ Clamps number within the inclusive lower and upper bounds.

```go
r1 := lo.Clamp(0, -10, 10)
// 10
// 0

r2 := lo.Clamp(-42, -10, 10)
// -42
// -10

r3 := lo.Clamp(42, -10, 10)
// 42
// 10
```

### T2 -> T9
Expand Down Expand Up @@ -841,7 +841,7 @@ Returns the difference between two collections.
left, right := lo.Difference[int]([]int{0, 1, 2, 3, 4, 5}, []int{0, 2, 6})
// []int{1, 3, 4, 5}, []int{6}

left, right := Difference[int]([]int{0, 1, 2, 3, 4, 5}, []int{0, 1, 2, 3, 4, 5})
left, right := lo.Difference[int]([]int{0, 1, 2, 3, 4, 5}, []int{0, 1, 2, 3, 4, 5})
// []int{}, []int{}
```

Expand Down

0 comments on commit 1ede5e1

Please sign in to comment.