2019-12-22 18:20:45 +01:00
|
|
|
# GoKit - xslice
|
|
|
|
|
|
|
|
Slice kits for Golang development.
|
|
|
|
|
|
|
|
## Installation
|
|
|
|
|
|
|
|
go get -u github.com/likexian/gokit
|
|
|
|
|
|
|
|
## Importing
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/likexian/gokit/xslice"
|
|
|
|
)
|
|
|
|
|
|
|
|
## Documentation
|
|
|
|
|
|
|
|
Visit the docs on [GoDoc](https://godoc.org/github.com/likexian/gokit/xslice)
|
|
|
|
|
|
|
|
## Example
|
|
|
|
|
|
|
|
### Get unique of string array
|
|
|
|
|
|
|
|
```go
|
|
|
|
array := xslice.Unique([]string{"a", "a", "b", "b", "b", "c"})
|
|
|
|
fmt.Println("new array:", array)
|
|
|
|
```
|
|
|
|
|
|
|
|
### Get unique of int array
|
|
|
|
|
|
|
|
```go
|
|
|
|
array := xslice.Unique([]int{0, 0, 1, 1, 1, 2, 2, 3})
|
|
|
|
fmt.Println("new array:", array)
|
|
|
|
```
|
|
|
|
|
2020-05-24 18:42:01 +02:00
|
|
|
## License
|
2019-12-22 18:20:45 +01:00
|
|
|
|
2023-03-17 13:19:17 +01:00
|
|
|
Copyright 2012-2023 [Li Kexian](https://www.likexian.com/)
|
2019-12-22 18:20:45 +01:00
|
|
|
|
|
|
|
Licensed under the Apache License 2.0
|
|
|
|
|
2020-05-24 18:42:01 +02:00
|
|
|
## Donation
|
2019-12-22 18:20:45 +01:00
|
|
|
|
2020-05-24 18:42:01 +02:00
|
|
|
If this project is helpful, please share it with friends.
|
2019-12-22 18:20:45 +01:00
|
|
|
|
2020-05-24 18:42:01 +02:00
|
|
|
If you want to thank me, you can [give me a cup of coffee](https://www.likexian.com/donate/).
|