Skip to content

Commit

Permalink
doc: improve doc for lo.Union
Browse files Browse the repository at this point in the history
  • Loading branch information
samber committed Oct 14, 2022
1 parent 6a2a333 commit a0c1ea3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Expand Up @@ -2,6 +2,11 @@

@samber: I sometimes forget to update this file. Ping me on [Twitter](https://twitter.com/samuelberthe) or open an issue in case of error. We need to keep a clear changelog for easier lib upgrade.

## 1.34.0 (2022-10-xx)

Improving:
- lo.Union: faster and can receive more than 2 lists

## 1.33.0 (2022-10-14)

Adding:
Expand Down
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -1664,10 +1664,10 @@ left, right := lo.Difference[int]([]int{0, 1, 2, 3, 4, 5}, []int{0, 1, 2, 3, 4,

### Union

Returns all distinct elements from both collections. Result will not change the order of elements relatively.
Returns all distinct elements from given collections. Result will not change the order of elements relatively.

```go
union := lo.Union[int]([]int{0, 1, 2, 3, 4, 5}, []int{0, 2, 10})
union := lo.Union[int]([]int{0, 1, 2, 3, 4, 5}, []int{0, 2}, []int{0, 10})
// []int{0, 1, 2, 3, 4, 5, 10}
```

Expand Down

0 comments on commit a0c1ea3

Please sign in to comment.