mirror of
https://github.com/duke-git/lancet.git
synced 2026-02-06 05:42:25 +08:00
doc: update slice document
This commit is contained in:
@@ -77,7 +77,7 @@ import (
|
||||
<b>Signature:</b>
|
||||
|
||||
```go
|
||||
func AppendIfAbsent[T comparable](slice []T, value T) []T
|
||||
func AppendIfAbsent(slice interface{}, value interface{}) interface{}
|
||||
```
|
||||
<b>Example:</b>
|
||||
|
||||
@@ -1012,7 +1012,7 @@ func main() {
|
||||
<b>Signature:</b>
|
||||
|
||||
```go
|
||||
func ToSlice[T any](value ...T) []T
|
||||
func ToSlice(value ...interface{}) interface{}
|
||||
```
|
||||
<b>Example:</b>
|
||||
|
||||
@@ -1036,7 +1036,7 @@ func main() {
|
||||
<b>Signature:</b>
|
||||
|
||||
```go
|
||||
func ToSlicePointer[T any](value ...T) []*T
|
||||
func ToSlicePointer(value ...interface{}) []*interface{}
|
||||
```
|
||||
<b>Example:</b>
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ import (
|
||||
<b>函数签名:</b>
|
||||
|
||||
```go
|
||||
func AppendIfAbsent[T comparable](slice []T, value T) []T
|
||||
func AppendIfAbsent(slice interface{}, value interface{}) interface{}
|
||||
```
|
||||
<b>例子:</b>
|
||||
|
||||
@@ -1011,7 +1011,7 @@ func main() {
|
||||
<b>函数签名:</b>
|
||||
|
||||
```go
|
||||
func ToSlice[T any](value ...T) []T
|
||||
func ToSlice(value ...interface{}) interface{}
|
||||
```
|
||||
<b>例子:</b>
|
||||
|
||||
@@ -1035,7 +1035,7 @@ func main() {
|
||||
<b>函数签名:</b>
|
||||
|
||||
```go
|
||||
func ToSlicePointer[T any](value ...T) []*T
|
||||
func ToSlicePointer(value ...interface{}) []*interface{}
|
||||
```
|
||||
<b>例子:</b>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user