mirror of
https://github.com/duke-git/lancet.git
synced 2026-02-04 12:52:28 +08:00
doc: update doc styles
This commit is contained in:
@@ -39,8 +39,6 @@ import (
|
||||
|
||||
<div STYLE="page-break-after: always;"></div>
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="/styles/api_doc.css">
|
||||
|
||||
## 文档
|
||||
|
||||
### <span id="BubbleSort">BubbleSort</span>
|
||||
@@ -53,7 +51,7 @@ import (
|
||||
func BubbleSort[T any](slice []T, comparator lancetconstraints.Comparator)
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/GNdv7Jg2Taj)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/GNdv7Jg2Taj)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -101,7 +99,7 @@ func main() {
|
||||
func InsertionSort[T any](slice []T, comparator lancetconstraints.Comparator)
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/G5LJiWgJJW6)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/G5LJiWgJJW6)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -164,7 +162,7 @@ func main() {
|
||||
func SelectionSort[T any](slice []T, comparator lancetconstraints.Comparator)
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/oXovbkekayS)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/oXovbkekayS)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -212,7 +210,7 @@ func main() {
|
||||
func ShellSort[T any](slice []T, comparator lancetconstraints.Comparator)
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/3ibkszpJEu3)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/3ibkszpJEu3)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -260,7 +258,7 @@ func main() {
|
||||
func QuickSort[T any](slice []T comparator lancetconstraints.Comparator)
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/7Y7c1Elk3ax)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/7Y7c1Elk3ax)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -308,7 +306,7 @@ func main() {
|
||||
func HeapSort[T any](slice []T, comparator lancetconstraints.Comparator)
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/u6Iwa1VZS_f)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/u6Iwa1VZS_f)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -356,7 +354,7 @@ func main() {
|
||||
func MergeSort[T any](slice []T, comparator lancetconstraints.Comparator)
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/ydinn9YzUJn)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/ydinn9YzUJn)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -404,7 +402,7 @@ func main() {
|
||||
func CountSort[T any](slice []T, comparator lancetconstraints.Comparator) []T
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/tB-Umgm0DrP)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/tB-Umgm0DrP)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -453,7 +451,7 @@ func main() {
|
||||
func BinarySearch[T any](sortedSlice []T, target T, lowIndex, highIndex int, comparator lancetconstraints.Comparator) int
|
||||
```
|
||||
|
||||
<b>示例: <span class="run-container">[运行](https://go.dev/play/p/t6MeGiUSN47)</span></b>
|
||||
<b>示例: <span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/t6MeGiUSN47)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -504,7 +502,7 @@ func main() {
|
||||
func BinaryIterativeSearch[T any](sortedSlice []T, target T, lowIndex, highIndex int, comparator lancetconstraints.Comparator) int
|
||||
```
|
||||
|
||||
<b>示例: <span class="run-container">[运行](https://go.dev/play/p/Anozfr8ZLH3)</span></b>
|
||||
<b>示例: <span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/Anozfr8ZLH3)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -555,7 +553,7 @@ func main() {
|
||||
func LinearSearch[T any](slice []T, target T, equal func(a, b T) bool) int
|
||||
```
|
||||
|
||||
<b>示例: <span class="run-container">[运行](https://go.dev/play/p/IsS7rgn5s3x)</span></b>
|
||||
<b>示例: <span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/IsS7rgn5s3x)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -598,7 +596,7 @@ func (l *LRUCache[K, V]) Delete(key K) bool
|
||||
func (l *LRUCache[K, V]) Len() int
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/-EZjgOURufP)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/-EZjgOURufP)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
|
||||
@@ -35,8 +35,6 @@ import (
|
||||
|
||||
<div STYLE="page-break-after: always;"></div>
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="/styles/api_doc.css">
|
||||
|
||||
## 文档
|
||||
|
||||
### <span id="Equal">Equal</span>
|
||||
@@ -49,7 +47,7 @@ import (
|
||||
func Equal(left, right any) bool
|
||||
```
|
||||
|
||||
<b>示例: <span class="run-container">[运行](https://go.dev/play/p/wmVxR-to4lz)</span></b>
|
||||
<b>示例: <span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/wmVxR-to4lz)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -98,7 +96,7 @@ func main() {
|
||||
func EqualValue(left, right any) bool
|
||||
```
|
||||
|
||||
<b>示例: <span class="run-container">[运行](https://go.dev/play/p/fxnna_LLD9u)</span></b>
|
||||
<b>示例: <span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/fxnna_LLD9u)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -137,7 +135,7 @@ func main() {
|
||||
func LessThan(left, right any) bool
|
||||
```
|
||||
|
||||
<b>示例: <span class="run-container">[运行](https://go.dev/play/p/cYh7FQQj0ne)</span></b>
|
||||
<b>示例: <span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/cYh7FQQj0ne)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -186,7 +184,7 @@ func main() {
|
||||
func GreaterThan(left, right any) bool
|
||||
```
|
||||
|
||||
<b>示例: <span class="run-container">[运行](https://go.dev/play/p/9-NYDFZmIMp)</span></b>
|
||||
<b>示例: <span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/9-NYDFZmIMp)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -238,7 +236,7 @@ func main() {
|
||||
func LessOrEqual(left, right any) bool
|
||||
```
|
||||
|
||||
<b>示例: <span class="run-container">[运行](https://go.dev/play/p/e4T_scwoQzp)</span></b>
|
||||
<b>示例: <span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/e4T_scwoQzp)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -287,7 +285,7 @@ func main() {
|
||||
func GreaterOrEqual(left, right any) bool
|
||||
```
|
||||
|
||||
<b>示例: <span class="run-container">[运行](https://go.dev/play/p/vx8mP0U8DFk)</span></b>
|
||||
<b>示例: <span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/vx8mP0U8DFk)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -339,7 +337,7 @@ func main() {
|
||||
func InDelta[T constraints.Integer | constraints.Float](left, right T, delta float64) bool
|
||||
```
|
||||
|
||||
<b>示例: <span class="run-container">[运行](https://go.dev/play/p/TuDdcNtMkjo)</span></b>
|
||||
<b>示例: <span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/TuDdcNtMkjo)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
|
||||
@@ -1,15 +1,17 @@
|
||||
# Concurrency
|
||||
并发包包含一些支持并发编程的功能。例如:goroutine, channel等。
|
||||
|
||||
并发包包含一些支持并发编程的功能。例如:goroutine, channel 等。
|
||||
|
||||
<div STYLE="page-break-after: always;"></div>
|
||||
|
||||
## 源码:
|
||||
|
||||
- [https://github.com/duke-git/lancet/blob/main/concurrency/channel.go](https://github.com/duke-git/lancet/blob/main/concurrency/channel.go)
|
||||
- [https://github.com/duke-git/lancet/blob/main/concurrency/channel.go](https://github.com/duke-git/lancet/blob/main/concurrency/channel.go)
|
||||
|
||||
<div STYLE="page-break-after: always;"></div>
|
||||
|
||||
## 用法:
|
||||
|
||||
```go
|
||||
import (
|
||||
"github.com/duke-git/lancet/v2/concurrency"
|
||||
@@ -19,25 +21,24 @@ import (
|
||||
<div STYLE="page-break-after: always;"></div>
|
||||
|
||||
## 目录
|
||||
|
||||
### Channel
|
||||
- [NewChannel](#NewChannel)
|
||||
- [Bridge](#Bridge)
|
||||
- [FanIn](#FanIn)
|
||||
- [Generate](#Generate)
|
||||
- [Or](#Or)
|
||||
- [OrDone](#OrDone)
|
||||
- [Repeat](#Repeat)
|
||||
- [RepeatFn](#RepeatFn)
|
||||
- [Take](#Take)
|
||||
- [Tee](#Tee)
|
||||
|
||||
- [NewChannel](#NewChannel)
|
||||
- [Bridge](#Bridge)
|
||||
- [FanIn](#FanIn)
|
||||
- [Generate](#Generate)
|
||||
- [Or](#Or)
|
||||
- [OrDone](#OrDone)
|
||||
- [Repeat](#Repeat)
|
||||
- [RepeatFn](#RepeatFn)
|
||||
- [Take](#Take)
|
||||
- [Tee](#Tee)
|
||||
|
||||
<div STYLE="page-break-after: always;"></div>
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="/styles/api_doc.css">
|
||||
|
||||
## 文档
|
||||
|
||||
|
||||
### Channel
|
||||
|
||||
### <span id="NewChannel">NewChannel</span>
|
||||
@@ -50,7 +51,8 @@ import (
|
||||
type Channel[T any] struct
|
||||
func NewChannel[T any]() *Channel[T]
|
||||
```
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/7aB4KyMMp9A)</span></b>
|
||||
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/7aB4KyMMp9A)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -74,7 +76,8 @@ func main() {
|
||||
```go
|
||||
func (c *Channel[T]) Bridge(ctx context.Context, chanStream <-chan <-chan T) <-chan T
|
||||
```
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/qmWSy1NVF-Y)</span></b>
|
||||
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/qmWSy1NVF-Y)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -126,7 +129,8 @@ func main() {
|
||||
```go
|
||||
func (c *Channel[T]) FanIn(ctx context.Context, channels ...<-chan T) <-chan T
|
||||
```
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/2VYFMexEvTm)</span></b>
|
||||
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/2VYFMexEvTm)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -165,7 +169,8 @@ func main() {
|
||||
```go
|
||||
func (c *Channel[T]) Generate(ctx context.Context, values ...T) <-chan T
|
||||
```
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/7aB4KyMMp9A)</span></b>
|
||||
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/7aB4KyMMp9A)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -203,7 +208,8 @@ func main() {
|
||||
```go
|
||||
func (c *Channel[T]) Repeat(ctx context.Context, values ...T) <-chan T
|
||||
```
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/k5N_ALVmYjE)</span></b>
|
||||
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/k5N_ALVmYjE)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -242,7 +248,8 @@ func main() {
|
||||
```go
|
||||
func (c *Channel[T]) RepeatFn(ctx context.Context, fn func() T) <-chan T
|
||||
```
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/4J1zAWttP85)</span></b>
|
||||
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/4J1zAWttP85)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -283,7 +290,8 @@ func main() {
|
||||
```go
|
||||
func (c *Channel[T]) Or(channels ...<-chan T) <-chan T
|
||||
```
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/Wqz9rwioPww)</span></b>
|
||||
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/Wqz9rwioPww)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -326,7 +334,8 @@ func main() {
|
||||
```go
|
||||
func (c *Channel[T]) OrDone(ctx context.Context, channel <-chan T) <-chan T
|
||||
```
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/lm_GoS6aDjo)</span></b>
|
||||
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/lm_GoS6aDjo)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -364,7 +373,8 @@ func main() {
|
||||
```go
|
||||
func (c *Channel[T]) Take(ctx context.Context, valueStream <-chan T, number int) <-chan T
|
||||
```
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/9Utt-1pDr2J)</span></b>
|
||||
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/9Utt-1pDr2J)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -410,7 +420,8 @@ func main() {
|
||||
```go
|
||||
func (c *Channel[T]) Tee(ctx context.Context, in <-chan T) (<-chan T, <-chan T)
|
||||
```
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/3TQPKnCirrP)</span></b>
|
||||
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/3TQPKnCirrP)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -440,4 +451,4 @@ func main() {
|
||||
// 1
|
||||
// 1
|
||||
}
|
||||
```
|
||||
```
|
||||
|
||||
@@ -31,8 +31,6 @@ import (
|
||||
|
||||
<div STYLE="page-break-after: always;"></div>
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="/styles/api_doc.css">
|
||||
|
||||
## 文档
|
||||
|
||||
### <span id="Bool">Bool</span>
|
||||
@@ -47,7 +45,7 @@ slices和map的length大于0时,返回true,否则返回false<br/>
|
||||
```go
|
||||
func Bool[T any](value T) bool
|
||||
```
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/ETzeDJRSvhm)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/ETzeDJRSvhm)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -111,7 +109,7 @@ func main() {
|
||||
```go
|
||||
func And[T, U any](a T, b U) bool
|
||||
```
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/W1SSUmt6pvr)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/W1SSUmt6pvr)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -137,7 +135,7 @@ func main() {
|
||||
```go
|
||||
func Or[T, U any](a T, b U) bool
|
||||
```
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/UlQTxHaeEkq)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/UlQTxHaeEkq)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -163,7 +161,7 @@ func main() {
|
||||
```go
|
||||
func Xor[T, U any](a T, b U) bool
|
||||
```
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/gObZrW7ZbG8)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/gObZrW7ZbG8)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -189,7 +187,7 @@ func main() {
|
||||
```go
|
||||
func Nor[T, U any](a T, b U) bool
|
||||
```
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/g2j08F_zZky)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/g2j08F_zZky)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -215,7 +213,7 @@ func main() {
|
||||
```go
|
||||
func Xnor[T, U any](a T, b U) bool
|
||||
```
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/OuDB9g51643)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/OuDB9g51643)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -241,7 +239,7 @@ func main() {
|
||||
```go
|
||||
func Nand[T, U any](a T, b U) bool
|
||||
```
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/vSRMLxLIbq8)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/vSRMLxLIbq8)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -267,7 +265,7 @@ func main() {
|
||||
```go
|
||||
func TernaryOperator[T, U any](isTrue T, ifValue U, elseValue U) U
|
||||
```
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/ElllPZY0guT)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/ElllPZY0guT)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
|
||||
@@ -46,8 +46,6 @@ import (
|
||||
|
||||
<div STYLE="page-break-after: always;"></div>
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="/styles/api_doc.css">
|
||||
|
||||
## 文档
|
||||
|
||||
### <span id="ColorHexToRGB">ColorHexToRGB</span>
|
||||
@@ -60,7 +58,7 @@ import (
|
||||
func ColorHexToRGB(colorHex string) (red, green, blue int)
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/o7_ft-JCJBV)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/o7_ft-JCJBV)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -91,7 +89,7 @@ func main() {
|
||||
func ColorRGBToHex(red, green, blue int) string
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/nzKS2Ro87J1)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/nzKS2Ro87J1)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -124,7 +122,7 @@ func main() {
|
||||
func ToBool(s string) (bool, error)
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/ARht2WnGdIN)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/ARht2WnGdIN)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -165,7 +163,7 @@ func main() {
|
||||
func ToBytes(data any) ([]byte, error)
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/fAMXYFDvOvr)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/fAMXYFDvOvr)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -198,7 +196,7 @@ func main() {
|
||||
func ToChar(s string) []string
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/JJ1SvbFkVdM)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/JJ1SvbFkVdM)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -234,7 +232,7 @@ func main() {
|
||||
func ToChannel[T any](array []T) <-chan T
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/hOx_oYZbAnL)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/hOx_oYZbAnL)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -271,7 +269,7 @@ func main() {
|
||||
func ToFloat(value any) (float64, error)
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/4YTmPCibqHJ)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/4YTmPCibqHJ)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -316,7 +314,7 @@ func main() {
|
||||
func ToInt(value any) (int64, error)
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/9_h9vIt-QZ_b)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/9_h9vIt-QZ_b)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -358,7 +356,7 @@ func main() {
|
||||
func ToJson(value any) (string, error)
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/2rLIkMmXWvR)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/2rLIkMmXWvR)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -393,7 +391,7 @@ func main() {
|
||||
func ToMap[T any, K comparable, V any](array []T, iteratee func(T) (K, V)) map[K]V
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/tVFy7E-t24l)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/tVFy7E-t24l)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -434,7 +432,7 @@ func main() {
|
||||
func ToPointer[T any](value T) *T
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/ASf_etHNlw1)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/ASf_etHNlw1)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -463,7 +461,7 @@ func main() {
|
||||
func ToString(value any) string
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/nF1zOOslpQq)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/nF1zOOslpQq)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -511,7 +509,7 @@ func main() {
|
||||
func StructToMap(value any) (map[string]any, error)
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/KYGYJqNUBOI)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/KYGYJqNUBOI)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -549,7 +547,7 @@ func main() {
|
||||
func MapToSlice[T any, K comparable, V any](aMap map[K]V, iteratee func(K, V) T) []T
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/dmX4Ix5V6Wl)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/dmX4Ix5V6Wl)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -579,7 +577,7 @@ func main() {
|
||||
func EncodeByte(data any) ([]byte, error)
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/DVmM1G5JfuP)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/DVmM1G5JfuP)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -608,7 +606,7 @@ func main() {
|
||||
func DecodeByte(data []byte, target any) error
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/zI6xsmuQRbn)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/zI6xsmuQRbn)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -644,7 +642,7 @@ func main() {
|
||||
func DeepClone[T any](src T) T
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/j4DP5dquxnk)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/j4DP5dquxnk)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -708,7 +706,7 @@ func main() {
|
||||
func CopyProperties[T, U any](dst T, src U) (err error)
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/oZujoB5Sgg5)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/oZujoB5Sgg5)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -787,7 +785,7 @@ func main() {
|
||||
func ToInterface(v reflect.Value) (value interface{}, ok bool)
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/syqw0-WG7Xd)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/syqw0-WG7Xd)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -822,7 +820,7 @@ func main() {
|
||||
func Utf8ToGbk(bs []byte) ([]byte, error)
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/9FlIaFLArIL)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/9FlIaFLArIL)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -856,7 +854,7 @@ func main() {
|
||||
func GbkToUtf8(bs []byte) ([]byte, error)
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/OphmHCN_9u8)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/OphmHCN_9u8)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
|
||||
@@ -68,8 +68,6 @@ import (
|
||||
|
||||
<div STYLE="page-break-after: always;"></div>
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="/styles/api_doc.css">
|
||||
|
||||
## 文档
|
||||
|
||||
### <span id="AesEcbEncrypt">AesEcbEncrypt</span>
|
||||
@@ -82,7 +80,7 @@ import (
|
||||
func AesEcbEncrypt(data, key []byte) []byte
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/zI6xsmuQRbn)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/zI6xsmuQRbn)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -116,7 +114,7 @@ func main() {
|
||||
func AesEcbDecrypt(encrypted, key []byte) []byte
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/zI6xsmuQRbn)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/zI6xsmuQRbn)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -150,7 +148,7 @@ func main() {
|
||||
func AesCbcEncrypt(data, key []byte) []byte
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/IOq_g8_lKZD)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/IOq_g8_lKZD)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -184,7 +182,7 @@ func main() {
|
||||
func AesCbcDecrypt(encrypted, key []byte) []byte
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/IOq_g8_lKZD)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/IOq_g8_lKZD)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -218,7 +216,7 @@ func main() {
|
||||
func AesCtrCrypt(data, key []byte) []byte
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/SpaZO0-5Nsp)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/SpaZO0-5Nsp)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -252,7 +250,7 @@ func main() {
|
||||
func AesCfbEncrypt(data, key []byte) []byte
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/tfkF10B13kH)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/tfkF10B13kH)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -286,7 +284,7 @@ func main() {
|
||||
func AesCfbDecrypt(encrypted, key []byte) []byte
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/tfkF10B13kH)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/tfkF10B13kH)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -320,7 +318,7 @@ func main() {
|
||||
func AesOfbEncrypt(data, key []byte) []byte
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/VtHxtkUj-3F)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/VtHxtkUj-3F)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -354,7 +352,7 @@ func main() {
|
||||
func AesOfbDecrypt(encrypted, key []byte) []byte
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/VtHxtkUj-3F)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/VtHxtkUj-3F)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -388,7 +386,7 @@ func main() {
|
||||
func Base64StdEncode(s string) string
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/VOaUyQUreoK)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/VOaUyQUreoK)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -417,7 +415,7 @@ func main() {
|
||||
func Base64StdDecode(s string) string
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/RWQylnJVgIe)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/RWQylnJVgIe)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -446,7 +444,7 @@ func main() {
|
||||
func DesEcbEncrypt(data, key []byte) []byte
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/8qivmPeZy4P)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/8qivmPeZy4P)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -481,7 +479,7 @@ func main() {
|
||||
func DesEcbDecrypt(encrypted, key []byte) []byte
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/8qivmPeZy4P)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/8qivmPeZy4P)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -516,7 +514,7 @@ func main() {
|
||||
func DesCbcEncrypt(data, key []byte) []byte
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/4cC4QvWfe3_1)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/4cC4QvWfe3_1)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -550,7 +548,7 @@ func main() {
|
||||
func DesCbcDecrypt(encrypted, key []byte) []byte
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/4cC4QvWfe3_1)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/4cC4QvWfe3_1)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -584,7 +582,7 @@ func main() {
|
||||
func DesCtrCrypt(data, key []byte) []byte
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/9-T6OjKpcdw)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/9-T6OjKpcdw)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -618,7 +616,7 @@ func main() {
|
||||
func DesCfbEncrypt(data, key []byte) []byte
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/y-eNxcFBlxL)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/y-eNxcFBlxL)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -652,7 +650,7 @@ func main() {
|
||||
func DesCfbDecrypt(encrypted, key []byte) []byte
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/y-eNxcFBlxL)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/y-eNxcFBlxL)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -686,7 +684,7 @@ func main() {
|
||||
func DesOfbEncrypt(data, key []byte) []byte
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/74KmNadjN1J)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/74KmNadjN1J)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -720,7 +718,7 @@ func main() {
|
||||
func DesOfbDecrypt(encrypted, key []byte) []byte
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/74KmNadjN1J)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/74KmNadjN1J)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -754,7 +752,7 @@ func main() {
|
||||
func HmacMd5(str, key string) string
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/uef0q1fz53I)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/uef0q1fz53I)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -786,7 +784,7 @@ func main() {
|
||||
func HmacMd5WithBase64(str, key string) string
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/UY0ng2AefFC)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/UY0ng2AefFC)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -818,7 +816,7 @@ func main() {
|
||||
func HmacSha1(str, key string) string
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/1UI4oQ4WXKM)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/1UI4oQ4WXKM)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -850,7 +848,7 @@ func main() {
|
||||
func HmacSha1WithBase64(str, key string) string
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/47JmmGrnF7B)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/47JmmGrnF7B)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -882,7 +880,7 @@ func main() {
|
||||
func HmacSha256(str, key string) string
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/HhpwXxFhhC0)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/HhpwXxFhhC0)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -914,7 +912,7 @@ func main() {
|
||||
func HmacSha256WithBase64(str, key string) string
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/EKbkUvPTLwO)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/EKbkUvPTLwO)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -946,7 +944,7 @@ func main() {
|
||||
func HmacSha512(str, key string) string
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/59Od6m4A0Ud)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/59Od6m4A0Ud)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -978,7 +976,7 @@ func main() {
|
||||
func HmacSha512WithBase64(str, key string) string
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/c6dSe3E2ydU)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/c6dSe3E2ydU)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -1010,7 +1008,7 @@ func main() {
|
||||
func Md5String(str string) string
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/1bLcVetbTOI)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/1bLcVetbTOI)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -1041,7 +1039,7 @@ func main() {
|
||||
func Md5StringWithBase64(s string) string
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/Tcb-Z7LN2ax)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/Tcb-Z7LN2ax)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -1070,7 +1068,7 @@ func main() {
|
||||
func Md5Byte(data []byte) string
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/suraalH8lyC)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/suraalH8lyC)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -1099,7 +1097,7 @@ func main() {
|
||||
func Md5ByteWithBase64(data []byte) string
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/Lx4gH7Vdr5_y)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/Lx4gH7Vdr5_y)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -1154,7 +1152,7 @@ func main() {
|
||||
func Sha1(str string) string
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/_m_uoD1deMT)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/_m_uoD1deMT)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -1185,7 +1183,7 @@ func main() {
|
||||
func Sha1WithBase64(str string) string
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/fSyx-Gl2l2-)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/fSyx-Gl2l2-)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -1214,7 +1212,7 @@ func main() {
|
||||
func Sha256(str string) string
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/tU9tfBMIAr1)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/tU9tfBMIAr1)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -1245,7 +1243,7 @@ func main() {
|
||||
func Sha256WithBase64(str string) string
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/85IXJHIal1k)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/85IXJHIal1k)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -1274,7 +1272,7 @@ func main() {
|
||||
func Sha512(str string) string
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/3WsvLYZxsHa)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/3WsvLYZxsHa)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -1305,7 +1303,7 @@ func main() {
|
||||
func Sha512WithBase64(str string) string
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/q_fY2rA-k5I)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/q_fY2rA-k5I)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -1334,7 +1332,7 @@ func main() {
|
||||
func GenerateRsaKey(keySize int, priKeyFile, pubKeyFile string) error
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/zutRHrDqs0X)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/zutRHrDqs0X)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -1362,7 +1360,7 @@ func main() {
|
||||
func RsaEncrypt(data []byte, pubKeyFileName string) []byte
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/uef0q1fz53I)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/uef0q1fz53I)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -1399,7 +1397,7 @@ func main() {
|
||||
func RsaDecrypt(data []byte, privateKeyFileName string) []byte
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/uef0q1fz53I)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/uef0q1fz53I)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
|
||||
@@ -67,8 +67,6 @@ import (
|
||||
|
||||
<div STYLE="page-break-after: always;"></div>
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="/styles/api_doc.css">
|
||||
|
||||
## 文档
|
||||
|
||||
## 注:
|
||||
@@ -108,7 +106,7 @@ import (
|
||||
func AddDay(t time.Time, day int64) time.Time
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/dIGbs_uTdFa)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/dIGbs_uTdFa)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -147,7 +145,7 @@ func main() {
|
||||
func AddHour(t time.Time, hour int64) time.Time
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/rcMjd7OCsi5)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/rcMjd7OCsi5)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -186,7 +184,7 @@ func main() {
|
||||
func AddMinute(t time.Time, minute int64) time.Time
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/nT1heB1KUUK)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/nT1heB1KUUK)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -225,7 +223,7 @@ func main() {
|
||||
func AddYear(t time.Time, year int64) time.Time
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/MqW2ujnBx10)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/MqW2ujnBx10)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -264,7 +262,7 @@ func main() {
|
||||
func BeginOfMinute(t time.Time) time.Time
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/ieOLVJ9CiFT)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/ieOLVJ9CiFT)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -296,7 +294,7 @@ func main() {
|
||||
func BeginOfHour(t time.Time) time.Time
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/GhdGFnDWpYs)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/GhdGFnDWpYs)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -328,7 +326,7 @@ func main() {
|
||||
func BeginOfDay(t time.Time) time.Time
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/94m_UT6cWs9)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/94m_UT6cWs9)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -360,7 +358,7 @@ func main() {
|
||||
func BeginOfWeek(t time.Time, beginFrom ...time.Weekday) time.Time
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/ynjoJPz7VNV)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/ynjoJPz7VNV)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -392,7 +390,7 @@ func main() {
|
||||
func BeginOfMonth(t time.Time) time.Time
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/bWXVFsmmzwL)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/bWXVFsmmzwL)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -424,7 +422,7 @@ func main() {
|
||||
func BeginOfYear(t time.Time) time.Time
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/i326DSwLnV8)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/i326DSwLnV8)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -456,7 +454,7 @@ func main() {
|
||||
func EndOfMinute(t time.Time) time.Time
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/yrL5wGzPj4z)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/yrL5wGzPj4z)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -488,7 +486,7 @@ func main() {
|
||||
func EndOfHour(t time.Time) time.Time
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/6ce3j_6cVqN)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/6ce3j_6cVqN)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -520,7 +518,7 @@ func main() {
|
||||
func EndOfDay(t time.Time) time.Time
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/eMBOvmq5Ih1)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/eMBOvmq5Ih1)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -552,7 +550,7 @@ func main() {
|
||||
func EndOfWeek(t time.Time, endWith ...time.Weekday) time.Time
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/i08qKXD9flf)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/i08qKXD9flf)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -584,7 +582,7 @@ func main() {
|
||||
func EndOfMonth(t time.Time) time.Time
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/_GWh10B3Nqi)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/_GWh10B3Nqi)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -616,7 +614,7 @@ func main() {
|
||||
func EndOfYear(t time.Time) time.Time
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/G01cKlMCvNm)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/G01cKlMCvNm)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -648,7 +646,7 @@ func main() {
|
||||
func GetNowDate() string
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/PvfkPpcpBBf)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/PvfkPpcpBBf)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -677,7 +675,7 @@ func main() {
|
||||
func GetNowTime() string
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/l7BNxCkTmJS)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/l7BNxCkTmJS)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -706,7 +704,7 @@ func main() {
|
||||
func GetNowDateTime() string
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/pI4AqngD0al)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/pI4AqngD0al)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -735,7 +733,7 @@ func main() {
|
||||
func GetTodayStartTime() string
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/84siyYF7t99)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/84siyYF7t99)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -764,7 +762,7 @@ func main() {
|
||||
func GetTodayEndTime() string
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/jjrLnfoqgn3)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/jjrLnfoqgn3)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -793,7 +791,7 @@ func main() {
|
||||
func GetZeroHourTimestamp() int64
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/QmL2oIaGE3q)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/QmL2oIaGE3q)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -822,7 +820,7 @@ func main() {
|
||||
func GetNightTimestamp() int64
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/UolysR3MYP1)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/UolysR3MYP1)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -851,7 +849,7 @@ func main() {
|
||||
func FormatTimeToStr(t time.Time, format string, timezone ...string) string
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/_Ia7M8H_OvE)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/_Ia7M8H_OvE)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -890,7 +888,7 @@ func main() {
|
||||
func FormatStrToTime(str, format string, timezone ...string) (time.Time, error)
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/1h9FwdU8ql4)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/1h9FwdU8ql4)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -929,7 +927,7 @@ type theTime struct {
|
||||
func NewUnixNow() *theTime
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/U4PPx-9D0oz)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/U4PPx-9D0oz)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -961,7 +959,7 @@ type theTime struct {
|
||||
func NewUnix(unix int64) *theTime
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/psoSuh_kLRt)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/psoSuh_kLRt)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -993,7 +991,7 @@ type theTime struct {
|
||||
func NewFormat(t string) (*theTime, error)
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/VkW08ZOaXPZ)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/VkW08ZOaXPZ)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -1025,7 +1023,7 @@ type theTime struct {
|
||||
func NewISO8601(iso8601 string) (*theTime, error)
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/mkhOHQkdeA2)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/mkhOHQkdeA2)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -1054,7 +1052,7 @@ func main() {
|
||||
func (t *theTime) ToUnix() int64
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/_LUiwAdocjy)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/_LUiwAdocjy)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -1083,7 +1081,7 @@ func main() {
|
||||
func (t *theTime) ToFormat() string
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/VkW08ZOaXPZ)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/VkW08ZOaXPZ)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -1112,7 +1110,7 @@ func main() {
|
||||
func (t *theTime) ToFormatForTpl(tpl string) string
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/nyXxXcQJ8L5)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/nyXxXcQJ8L5)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -1142,7 +1140,7 @@ func main() {
|
||||
func (t *theTime) ToIso8601() string
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/mkhOHQkdeA2)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/mkhOHQkdeA2)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -1172,7 +1170,7 @@ func main() {
|
||||
func IsLeapYear(year int) bool
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/xS1eS2ejGew)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/xS1eS2ejGew)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -1205,7 +1203,7 @@ func main() {
|
||||
func BetweenSeconds(t1 time.Time, t2 time.Time) int64
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/n3YDRyfyXJu)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/n3YDRyfyXJu)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -1242,7 +1240,7 @@ func main() {
|
||||
func DayOfYear(t time.Time) int
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/0hjqhTwFNlH)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/0hjqhTwFNlH)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -1283,7 +1281,7 @@ func main() {
|
||||
func IsWeekend(t time.Time) bool
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/cupRM5aZOIY)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/cupRM5aZOIY)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -1323,7 +1321,7 @@ func main() {
|
||||
func NowDateOrTime(format string, timezone ...string) string
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/EZ-begEjtT0)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/EZ-begEjtT0)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -1357,7 +1355,7 @@ func main() {
|
||||
func Timestamp(timezone ...string) int64
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/iU5b7Vvjx6x)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/iU5b7Vvjx6x)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -1388,7 +1386,7 @@ func main() {
|
||||
func TimestampMilli(timezone ...string) int64
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/4gvEusOTu1T)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/4gvEusOTu1T)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -1418,7 +1416,7 @@ func main() {
|
||||
func TimestampMicro(timezone ...string) int64
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/2maANglKHQE)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/2maANglKHQE)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -1448,7 +1446,7 @@ func main() {
|
||||
func TimestampNano(timezone ...string) int64
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/A9Oq_COrcCF)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/A9Oq_COrcCF)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
|
||||
@@ -50,8 +50,6 @@ import (
|
||||
|
||||
<div STYLE="page-break-after: always;"></div>
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="/styles/api_doc.css">
|
||||
|
||||
## 文档
|
||||
|
||||
### <span id="ClearFile">ClearFile</span>
|
||||
@@ -64,7 +62,7 @@ import (
|
||||
func ClearFile(path string) error
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/NRZ0ZT-G94H)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/NRZ0ZT-G94H)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -92,7 +90,7 @@ func main() {
|
||||
func CreateFile(path string) bool
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/lDt8PEsTNKI)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/lDt8PEsTNKI)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -118,7 +116,7 @@ func main() {
|
||||
func CreateDir(absPath string) error
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/qUuCe1OGQnM)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/qUuCe1OGQnM)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -144,7 +142,7 @@ func main() {
|
||||
func CopyFile(srcPath string, dstPath string) error
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/Jg9AMJMLrJi)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/Jg9AMJMLrJi)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -172,7 +170,7 @@ func main() {
|
||||
func CurrentPath() string
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/s74a9iBGcSw)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/s74a9iBGcSw)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -198,7 +196,7 @@ func main() {
|
||||
func FileMode(path string) (fs.FileMode, error)
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/2l2hI42fA3p)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/2l2hI42fA3p)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -227,7 +225,7 @@ func main() {
|
||||
func MiMeType(file any) string
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/bd5sevSUZNu)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/bd5sevSUZNu)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -258,7 +256,7 @@ func main() {
|
||||
func IsExist(path string) bool
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/nKKXt8ZQbmh)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/nKKXt8ZQbmh)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -285,7 +283,7 @@ func main() {
|
||||
func IsLink(path string) bool
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/TL-b-Kzvf44)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/TL-b-Kzvf44)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -311,7 +309,7 @@ func main() {
|
||||
func IsDir(path string) bool
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/WkVwEKqtOWk)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/WkVwEKqtOWk)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -340,7 +338,7 @@ func main() {
|
||||
func ListFileNames(path string) ([]string, error)
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/Tjd7Y07rejl)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/Tjd7Y07rejl)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -366,7 +364,7 @@ func main() {
|
||||
func RemoveFile(path string) error
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/P2y0XW8a1SH)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/P2y0XW8a1SH)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -394,7 +392,7 @@ func main() {
|
||||
func ReadFileToString(path string) (string, error)
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/cmfwp_5SQTp)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/cmfwp_5SQTp)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -427,7 +425,7 @@ func main() {
|
||||
func ReadFileByLine(path string)([]string, error)
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/svJP_7ZrBrD)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/svJP_7ZrBrD)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -461,7 +459,7 @@ func main() {
|
||||
func Zip(fpath string, destPath string) error
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/j-3sWBp8ik_P)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/j-3sWBp8ik_P)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -489,7 +487,7 @@ func main() {
|
||||
func ZipAppendEntry(fpath string, destPath string) error
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/cxvaT8TRNQp)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/cxvaT8TRNQp)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -517,7 +515,7 @@ func main() {
|
||||
func UnZip(zipFile string, destPath string) error
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/g0w34kS7B8m)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/g0w34kS7B8m)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -545,7 +543,7 @@ func main() {
|
||||
func IsZipFile(filepath string) bool
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/9M0g2j_uF_e)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/9M0g2j_uF_e)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -571,7 +569,7 @@ func main() {
|
||||
func FileSize(path string) (int64, error)
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/H9Z05uD-Jjc)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/H9Z05uD-Jjc)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -603,7 +601,7 @@ func main() {
|
||||
func MTime(filepath string) (int64, error)
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/s_Tl7lZoAaY)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/s_Tl7lZoAaY)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -635,7 +633,7 @@ func main() {
|
||||
func Sha(filepath string, shaType ...int) (string, error)
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/VfEEcO2MJYf)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/VfEEcO2MJYf)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -673,7 +671,7 @@ func main() {
|
||||
func ReadCsvFile(filepath string) ([][]string, error)
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/OExTkhGEd3_u)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/OExTkhGEd3_u)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -705,7 +703,7 @@ func main() {
|
||||
func WriteCsvFile(filepath string, records [][]string, append bool) error
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/dAXm58Q5U1o)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/dAXm58Q5U1o)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -754,7 +752,7 @@ func main() {
|
||||
func WriteBytesToFile(filepath string, content []byte) error
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/s7QlDxMj3P8)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/s7QlDxMj3P8)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -803,7 +801,7 @@ func main() {
|
||||
func WriteStringToFile(filepath string, content string, append bool) error
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/GhLS6d8lH_g)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/GhLS6d8lH_g)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
|
||||
@@ -33,8 +33,6 @@ import (
|
||||
|
||||
<div STYLE="page-break-after: always;"></div>
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="/styles/api_doc.css">
|
||||
|
||||
## 文档
|
||||
|
||||
### <span id="Comma">Comma</span>
|
||||
@@ -47,7 +45,7 @@ import (
|
||||
func Comma[T constraints.Float | constraints.Integer | string](value T, symbol string) string
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/eRD5k2vzUVX)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/eRD5k2vzUVX)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -83,7 +81,7 @@ func main() {
|
||||
func Pretty(v any) (string, error)
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/YsciGj3FH2x)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/YsciGj3FH2x)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -122,7 +120,7 @@ func main() {
|
||||
func PrettyToWriter(v any, out io.Writer) error
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/LPLZ3lDi5ma)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/LPLZ3lDi5ma)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -165,7 +163,7 @@ func main() {
|
||||
func DecimalBytes(size float64, precision ...int) string
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/FPXs1suwRcs)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/FPXs1suwRcs)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -204,7 +202,7 @@ func main() {
|
||||
func BinaryBytes(size float64, precision ...int) string
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/G9oHHMCAZxP)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/G9oHHMCAZxP)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -243,7 +241,7 @@ func main() {
|
||||
func ParseDecimalBytes(size string) (uint64, error)
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/Am98ybWjvjj)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/Am98ybWjvjj)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -282,7 +280,7 @@ func main() {
|
||||
func ParseBinaryBytes(size string) (uint64, error)
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/69v1tTT62x8)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/69v1tTT62x8)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
|
||||
@@ -37,8 +37,6 @@ import (
|
||||
|
||||
## 文档
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="/styles/api_doc.css">
|
||||
|
||||
### <span id="After">After</span>
|
||||
|
||||
<p>创建一个函数,当他被调用n或更多次之后将马上触发fn</p>
|
||||
@@ -49,7 +47,7 @@ import (
|
||||
func After(n int, fn any) func(args ...any) []reflect.Value
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/eRD5k2vzUVX)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/eRD5k2vzUVX)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -82,7 +80,7 @@ func main() {
|
||||
func Before(n int, fn any) func(args ...any) []reflect.Value
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/0HqUDIFZ3IL)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/0HqUDIFZ3IL)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -119,7 +117,7 @@ type CurryFn[T any] func(...T) T
|
||||
func (cf CurryFn[T]) New(val T) func(...T) T
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/5HopfDwANKX)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/5HopfDwANKX)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -158,7 +156,7 @@ func main() {
|
||||
func Compose[T any](fnList ...func(...T) T) func(...T) T
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/KKfugD4PKYF)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/KKfugD4PKYF)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -196,7 +194,7 @@ func main() {
|
||||
func Debounced(fn func(), duration time.Duration) func()
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/absuEGB_GN7)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/absuEGB_GN7)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -246,7 +244,7 @@ func main() {
|
||||
func Delay(delay time.Duration, fn any, args ...any)
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/Ivtc2ZE-Tye)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/Ivtc2ZE-Tye)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -278,7 +276,7 @@ func main() {
|
||||
func Schedule(d time.Duration, fn any, args ...any) chan bool
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/hbON-Xeyn5N)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/hbON-Xeyn5N)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -317,7 +315,7 @@ func main() {
|
||||
func Pipeline[T any](funcs ...func(T) T) func(T) T
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/mPdUVvj6HD6)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/mPdUVvj6HD6)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -369,7 +367,7 @@ func (w *Watcher) GetElapsedTime() time.Duration
|
||||
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/l2yrOpCLd1I)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/l2yrOpCLd1I)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
|
||||
@@ -55,8 +55,6 @@ import (
|
||||
|
||||
<div STYLE="page-break-after: always;"></div>
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="/styles/api_doc.css">
|
||||
|
||||
## API 文档:
|
||||
|
||||
### <span id="MapTo">MapTo</span>
|
||||
@@ -69,7 +67,7 @@ import (
|
||||
func MapTo(src any, dst any) error
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/4K7KBEPgS5M)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/4K7KBEPgS5M)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -126,7 +124,7 @@ func main() {
|
||||
func ForEach[K comparable, V any](m map[K]V, iteratee func(key K, value V))
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/OaThj6iNVXK)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/OaThj6iNVXK)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -167,7 +165,7 @@ func main() {
|
||||
func Filter[K comparable, V any](m map[K]V, predicate func(key K, value V) bool) map[K]V
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/fSvF3wxuNG7)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/fSvF3wxuNG7)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -212,7 +210,7 @@ func main() {
|
||||
func FilterByKeys[K comparable, V any](m map[K]V, keys []K) map[K]V
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/7ov6BJHbVqh)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/7ov6BJHbVqh)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -250,7 +248,7 @@ func main() {
|
||||
func FilterByValues[K comparable, V comparable](m map[K]V, values []V) map[K]V
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/P3-9MdcXegR)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/P3-9MdcXegR)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -288,7 +286,7 @@ func main() {
|
||||
func OmitBy[K comparable, V any](m map[K]V, predicate func(key K, value V) bool) map[K]V
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/YJM4Hj5hNwm)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/YJM4Hj5hNwm)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -329,7 +327,7 @@ func main() {
|
||||
func OmitByKeys[K comparable, V any](m map[K]V, keys []K) map[K]V
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/jXGrWDBfSRp)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/jXGrWDBfSRp)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -367,7 +365,7 @@ func main() {
|
||||
func OmitByValues[K comparable, V comparable](m map[K]V, values []V) map[K]V
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/XB7Y10uw20_U)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/XB7Y10uw20_U)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -405,7 +403,7 @@ func main() {
|
||||
func Intersect[K comparable, V any](maps ...map[K]V) map[K]V
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/Zld0oj3sjcC)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/Zld0oj3sjcC)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -460,7 +458,7 @@ func main() {
|
||||
func Keys[K comparable, V any](m map[K]V) []K
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/xNB5bTb97Wd)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/xNB5bTb97Wd)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -499,7 +497,7 @@ func main() {
|
||||
func Merge[K comparable, V any](maps ...map[K]V) map[K]V
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/H95LENF1uB-)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/H95LENF1uB-)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -538,7 +536,7 @@ func main() {
|
||||
func Minus[K comparable, V any](mapA, mapB map[K]V) map[K]V
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/3u5U9K7YZ9m)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/3u5U9K7YZ9m)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -580,7 +578,7 @@ func main() {
|
||||
func Values[K comparable, V any](m map[K]V) []V
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/CBKdUc5FTW6)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/CBKdUc5FTW6)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -617,7 +615,7 @@ func main() {
|
||||
func KeysBy[K comparable, V any, T any](m map[K]V, mapper func(item K) T) []T
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/hI371iB8Up8)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/hI371iB8Up8)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -658,7 +656,7 @@ func main() {
|
||||
func ValuesBy[K comparable, V any, T any](m map[K]V, mapper func(item V) T) []T
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/sg9-oRidh8f)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/sg9-oRidh8f)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -707,7 +705,7 @@ func main() {
|
||||
func MapKeys[K comparable, V any, T comparable](m map[K]V, iteratee func(key K, value V) T) map[T]V
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/8scDxWeBDKd)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/8scDxWeBDKd)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -746,7 +744,7 @@ func main() {
|
||||
func MapValues[K comparable, V any, T any](m map[K]V, iteratee func(key K, value V) T) map[K]T
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/g92aY3fc7Iw)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/g92aY3fc7Iw)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -789,7 +787,7 @@ type Entry[K comparable, V any] struct {
|
||||
func Entries[K comparable, V any](m map[K]V) []Entry[K, V]
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/Ltb11LNcElY)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/Ltb11LNcElY)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -834,7 +832,7 @@ type Entry[K comparable, V any] struct {
|
||||
func FromEntries[K comparable, V any](entries []Entry[K, V]) map[K]V
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/C8L4ul9TVwf)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/C8L4ul9TVwf)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -868,7 +866,7 @@ func main() {
|
||||
func Transform[K1 comparable, V1 any, K2 comparable, V2 any](m map[K1]V1, iteratee func(key K1, value V1) (K2, V2)) map[K2]V2
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/P6ovfToM3zj)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/P6ovfToM3zj)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -907,7 +905,7 @@ func main() {
|
||||
func IsDisjoint[K comparable, V any](mapA, mapB map[K]V) bool
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/N9qgYg_Ho6f)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/N9qgYg_Ho6f)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -962,7 +960,7 @@ if haskey {
|
||||
func HasKey[K comparable, V any](m map[K]V, key K) bool
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/isZZHOsDhFc)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/isZZHOsDhFc)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -1001,7 +999,7 @@ func main() {
|
||||
func NewConcurrentMap[K comparable, V any](shardCount int) *ConcurrentMap[K, V]
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/3PenTPETJT0)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/3PenTPETJT0)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -1027,7 +1025,7 @@ func main() {
|
||||
func (cm *ConcurrentMap[K, V]) Set(key K, value V)
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/3PenTPETJT0)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/3PenTPETJT0)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -1081,7 +1079,7 @@ func main() {
|
||||
func (cm *ConcurrentMap[K, V]) Get(key K) (V, bool)
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/3PenTPETJT0)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/3PenTPETJT0)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -1135,7 +1133,7 @@ func main() {
|
||||
func (cm *ConcurrentMap[K, V]) GetOrSet(key K, value V) (actual V, ok bool)
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/aDcDApOK01a)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/aDcDApOK01a)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -1179,7 +1177,7 @@ func main() {
|
||||
func (cm *ConcurrentMap[K, V]) Delete(key K)
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/uTIJZYhpVMS)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/uTIJZYhpVMS)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -1225,7 +1223,7 @@ func main() {
|
||||
func (cm *ConcurrentMap[K, V]) GetAndDelete(key K) (actual V, ok bool)
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/ZyxeIXSZUiM)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/ZyxeIXSZUiM)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -1276,7 +1274,7 @@ func main() {
|
||||
func (cm *ConcurrentMap[K, V]) Has(key K) bool
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/C8L4ul9TVwf)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/C8L4ul9TVwf)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -1324,7 +1322,7 @@ func main() {
|
||||
func (cm *ConcurrentMap[K, V]) Range(iterator func(key K, value V) bool)
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/iqcy7P8P0Pr)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/iqcy7P8P0Pr)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
|
||||
@@ -50,8 +50,6 @@ import (
|
||||
|
||||
<div STYLE="page-break-after: always;"></div>
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="../../styles/api_doc.css">
|
||||
|
||||
## 文档
|
||||
|
||||
### <span id="Average">Average</span>
|
||||
@@ -64,7 +62,7 @@ import (
|
||||
func Average[T constraints.Integer | constraints.Float](numbers ...T) T
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/HFd70x4DrMj)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/HFd70x4DrMj)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -99,7 +97,7 @@ func main() {
|
||||
func Exponent(x, n int64) int64
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/Vv7LBwER-pz)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/Vv7LBwER-pz)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -135,7 +133,7 @@ func main() {
|
||||
func Fibonacci(first, second, n int) int
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/IscseUNMuUc)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/IscseUNMuUc)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -171,7 +169,7 @@ func main() {
|
||||
func Factorial(x uint) uint
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/tt6LdOK67Nx)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/tt6LdOK67Nx)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -207,7 +205,7 @@ func main() {
|
||||
func Max[T constraints.Integer | constraints.Float](numbers ...T) T
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/cN8DHI0rTkH)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/cN8DHI0rTkH)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -240,7 +238,7 @@ func main() {
|
||||
func MaxBy[T any](slice []T, comparator func(T, T) bool) T
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/pbe2MT-7DV2)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/pbe2MT-7DV2)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -284,7 +282,7 @@ func main() {
|
||||
func Min[T constraints.Integer | constraints.Float](numbers ...T) T
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/pbe2MT-7DV2)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/pbe2MT-7DV2)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -317,7 +315,7 @@ func main() {
|
||||
func MinBy[T any](slice []T, comparator func(T, T) bool) T
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/N9qgYg_Ho6f)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/N9qgYg_Ho6f)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -361,7 +359,7 @@ func main() {
|
||||
func Percent(val, total float64, n int) float64
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/s0NdFCtwuyd)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/s0NdFCtwuyd)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -397,7 +395,7 @@ func main() {
|
||||
func RoundToFloat(x float64, n int) float64
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/ghyb528JRJL)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/ghyb528JRJL)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -433,7 +431,7 @@ func main() {
|
||||
func RoundToString(x float64, n int) string
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/kZwpBRAcllO)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/kZwpBRAcllO)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -469,7 +467,7 @@ func main() {
|
||||
func TruncRound(x float64, n int) float64
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/aumarSHIGzP)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/aumarSHIGzP)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -505,7 +503,7 @@ func main() {
|
||||
func Range[T constraints.Integer | constraints.Float](start T, count int) []T
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/9ke2opxa8ZP)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/9ke2opxa8ZP)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -544,7 +542,7 @@ func main() {
|
||||
func RangeWithStep[T constraints.Integer | constraints.Float](start, end, step T) []T
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/akLWz0EqOSM)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/akLWz0EqOSM)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -583,7 +581,7 @@ func main() {
|
||||
func AngleToRadian(angle float64) float64
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/CIvlICqrHql)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/CIvlICqrHql)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -619,7 +617,7 @@ func main() {
|
||||
func RadianToAngle(radian float64) float64
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/dQtmOTUOMgi)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/dQtmOTUOMgi)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -655,7 +653,7 @@ func main() {
|
||||
func PointDistance(x1, y1, x2, y2 float64) float64
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/RrG4JIaziM8)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/RrG4JIaziM8)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -685,7 +683,7 @@ func main() {
|
||||
func IsPrime(n int) bool
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/Rdd8UTHZJ7u)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/Rdd8UTHZJ7u)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -724,7 +722,7 @@ func main() {
|
||||
func GCD[T constraints.Integer](integers ...T) T
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/CiEceLSoAKB)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/CiEceLSoAKB)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -766,7 +764,7 @@ func main() {
|
||||
func LCM[T constraints.Integer](integers ...T) T
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/EjcZxfY7G_g)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/EjcZxfY7G_g)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -802,7 +800,7 @@ func main() {
|
||||
func Cos(radian float64, precision ...int) float64
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/Sm89LoIfvFq)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/Sm89LoIfvFq)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -844,7 +842,7 @@ func main() {
|
||||
func Sin(radian float64, precision ...int) float64
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/TWMQlMywDsP)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/TWMQlMywDsP)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -886,7 +884,7 @@ func main() {
|
||||
func Log(n, base float64) float64
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/_d4bi8oyhat)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/_d4bi8oyhat)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -922,7 +920,7 @@ func main() {
|
||||
func Sum[T constraints.Integer | constraints.Float](numbers ...T) T
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/1To2ImAMJA7)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/1To2ImAMJA7)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -955,7 +953,7 @@ func main() {
|
||||
func Abs[T constraints.Integer | constraints.Float](x T) T
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/fsyBh1Os-1d)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/fsyBh1Os-1d)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
|
||||
@@ -51,8 +51,6 @@ import (
|
||||
|
||||
<div STYLE="page-break-after: always;"></div>
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="/styles/api_doc.css">
|
||||
|
||||
## 文档
|
||||
|
||||
### <span id="ConvertMapToQueryString">ConvertMapToQueryString</span>
|
||||
@@ -65,7 +63,7 @@ import (
|
||||
func ConvertMapToQueryString(param map[string]any) string
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/jnNt_qoSnRi)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/jnNt_qoSnRi)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -100,7 +98,7 @@ func main() {
|
||||
func EncodeUrl(urlStr string) (string, error)
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/bsZ6BRC4uKI)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/bsZ6BRC4uKI)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -135,7 +133,7 @@ func main() {
|
||||
func GetInternalIp() string
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/fxnna_LLD9u)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/fxnna_LLD9u)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -167,7 +165,7 @@ func main() {
|
||||
func GetIps() []string
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/NUFfcEmukx1)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/NUFfcEmukx1)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -197,7 +195,7 @@ func main() {
|
||||
func GetMacAddrs() []string {
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/Rq9UUBS_Xp1)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/Rq9UUBS_Xp1)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -241,7 +239,7 @@ type PublicIpInfo struct {
|
||||
}
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/YDxIfozsRHR)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/YDxIfozsRHR)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -271,7 +269,7 @@ func main() {
|
||||
func GetRequestPublicIp(req *http.Request) string
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/kxU-YDc_eBo)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/kxU-YDc_eBo)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -309,7 +307,7 @@ func main() {
|
||||
func IsPublicIP(IP net.IP) bool
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/nmktSQpJZnn)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/nmktSQpJZnn)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -346,7 +344,7 @@ func main() {
|
||||
func IsInternalIP(IP net.IP) bool
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/sYGhXbgO4Cb)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/sYGhXbgO4Cb)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -390,7 +388,7 @@ type HttpRequest struct {
|
||||
}
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/jUSgynekH7G)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/jUSgynekH7G)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -447,7 +445,7 @@ func NewHttpClientWithConfig(config *HttpClientConfig) *HttpClient
|
||||
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/jUSgynekH7G)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/jUSgynekH7G)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -478,7 +476,7 @@ func main() {
|
||||
func (client *HttpClient) SendRequest(request *HttpRequest) (*http.Response, error)
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/jUSgynekH7G)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/jUSgynekH7G)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -532,7 +530,7 @@ func main() {
|
||||
func (client *HttpClient) DecodeResponse(resp *http.Response, target any) error
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/jUSgynekH7G)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/jUSgynekH7G)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -586,7 +584,7 @@ func main() {
|
||||
func StructToUrlValues(targetStruct any) url.Values
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/pFqMkM40w9z)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/pFqMkM40w9z)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -968,7 +966,7 @@ func main() {
|
||||
func IsPingConnected(host string) bool
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/q8OzTijsA87)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/q8OzTijsA87)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -1001,7 +999,7 @@ func main() {
|
||||
func IsTelnetConnected(host string, port string) bool
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/yiLCGtQv_ZG)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/yiLCGtQv_ZG)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
|
||||
@@ -30,8 +30,6 @@ import (
|
||||
|
||||
<div STYLE="page-break-after: always;"></div>
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="/styles/api_doc.css">
|
||||
|
||||
## 文档
|
||||
|
||||
### <span id="Of">Of</span>
|
||||
@@ -44,7 +42,7 @@ import (
|
||||
func Of[T any](v T) *T
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/HFd70x4DrMj)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/HFd70x4DrMj)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -77,7 +75,7 @@ func main() {
|
||||
func Unwrap[T any](p *T) T
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/cgeu3g7cjWb)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/cgeu3g7cjWb)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -113,7 +111,7 @@ func main() {
|
||||
func ExtractPointer(value any) any
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/D7HFjeWU2ZP)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/D7HFjeWU2ZP)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -148,7 +146,7 @@ func main() {
|
||||
UnwarpOr[T any](p *T, fallback T) T
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/mmNaLC38W8C)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/mmNaLC38W8C)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -193,7 +191,7 @@ func main() {
|
||||
UnwarpOrDefault[T any](p *T) T
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/ZnGIHf8_o4E)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/ZnGIHf8_o4E)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
|
||||
@@ -34,8 +34,6 @@ import (
|
||||
|
||||
<div STYLE="page-break-after: always;"></div>
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="/styles/api_doc.css">
|
||||
|
||||
## 文档
|
||||
|
||||
### <span id="RandBytes">RandBytes</span>
|
||||
|
||||
@@ -30,7 +30,6 @@ import (
|
||||
|
||||
<div STYLE="page-break-after: always;"></div>
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="/styles/api_doc.css">
|
||||
|
||||
## 文档
|
||||
|
||||
@@ -44,7 +43,7 @@ import (
|
||||
func Context(ctx context.Context)
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/xnAOOXv9GkS)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/xnAOOXv9GkS)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -91,7 +90,7 @@ func main() {
|
||||
type RetryFunc func() error
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/nk2XRmagfVF)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/nk2XRmagfVF)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -137,7 +136,7 @@ func main() {
|
||||
func RetryTimes(n uint)
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/ssfVeU2SwLO)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/ssfVeU2SwLO)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -180,7 +179,7 @@ func main() {
|
||||
func RetryDuration(d time.Duration)
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/nk2XRmagfVF)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/nk2XRmagfVF)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -226,7 +225,7 @@ func main() {
|
||||
func Retry(retryFunc RetryFunc, opts ...Option) error
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/nk2XRmagfVF)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/nk2XRmagfVF)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
|
||||
@@ -94,7 +94,6 @@ import (
|
||||
|
||||
<div STYLE="page-break-after: always;"></div>
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="/styles/api_doc.css">
|
||||
|
||||
## 文档
|
||||
|
||||
@@ -108,7 +107,7 @@ import (
|
||||
func AppendIfAbsent[T comparable](slice []T, item T) []T
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/GNdv7Jg2Taj)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/GNdv7Jg2Taj)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -139,7 +138,7 @@ func main() {
|
||||
func Contain[T comparable](slice []T, target T) bool
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/_454yEHcNjf)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/_454yEHcNjf)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -170,7 +169,7 @@ func main() {
|
||||
func ContainBy[T any](slice []T, predicate func(item T) bool) bool
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/49tkHfX4GNc)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/49tkHfX4GNc)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -215,7 +214,7 @@ func main() {
|
||||
func ContainSubSlice[T comparable](slice, subSlice []T) bool
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/bcuQ3UT6Sev)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/bcuQ3UT6Sev)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -246,7 +245,7 @@ func main() {
|
||||
func Chunk[T any](slice []T, size int) [][]T
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/b4Pou5j2L_C)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/b4Pou5j2L_C)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -288,7 +287,7 @@ func main() {
|
||||
func Compact[T comparable](slice []T) []T
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/pO5AnxEr3TK)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/pO5AnxEr3TK)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -325,7 +324,7 @@ func main() {
|
||||
func Concat[T any](slice []T, slices ...[]T) []T
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/gPt-q7zr5mk)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/gPt-q7zr5mk)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -356,7 +355,7 @@ func main() {
|
||||
func Count[T comparable](slice []T, item T) int
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/Mj4oiEnQvRJ)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/Mj4oiEnQvRJ)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -389,7 +388,7 @@ func main() {
|
||||
func CountBy[T any](slice []T, predicate func(index int, item T) bool) int
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/tHOccTMDZCC)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/tHOccTMDZCC)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -423,7 +422,7 @@ func main() {
|
||||
func Difference[T comparable](slice, comparedSlice []T) []T
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/VXvadzLzhDa)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/VXvadzLzhDa)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -454,7 +453,7 @@ func main() {
|
||||
func DifferenceBy[T comparable](slice []T, comparedSlice []T, iteratee func(index int, item T) T) []T
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/DiivgwM5OnC)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/DiivgwM5OnC)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -489,7 +488,7 @@ func main() {
|
||||
func DifferenceWith[T any](slice []T, comparedSlice []T, comparator func(value, otherValue T) bool) []T
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/v2U2deugKuV)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/v2U2deugKuV)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -524,7 +523,7 @@ func main() {
|
||||
func DeleteAt[T any](slice []T, start int, end ...int)
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/pJ-d6MUWcvK)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/pJ-d6MUWcvK)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -559,7 +558,7 @@ func main() {
|
||||
func Drop[T any](slice []T, n int) []T
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/jnPO2yQsT8H)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/jnPO2yQsT8H)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -596,7 +595,7 @@ func main() {
|
||||
func DropRight[T any](slice []T, n int) []T
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/8bcXvywZezG)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/8bcXvywZezG)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -633,7 +632,7 @@ func main() {
|
||||
func DropWhile[T any](slice []T, predicate func(item T) bool) []T
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/4rt252UV_qs)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/4rt252UV_qs)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -673,7 +672,7 @@ func main() {
|
||||
func DropRightWhile[T any](slice []T, predicate func(item T) bool) []T
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/6wyK3zMY56e)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/6wyK3zMY56e)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -715,7 +714,7 @@ func main() {
|
||||
func Every[T any](slice []T, predicate func(index int, item T) bool) bool
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/R8U6Sl-j8cD)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/R8U6Sl-j8cD)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -749,7 +748,7 @@ func main() {
|
||||
func Equal[T comparable](slice1, slice2 []T) bool
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/WcRQJ37ifPa)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/WcRQJ37ifPa)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -784,7 +783,7 @@ func main() {
|
||||
func EqualWith[T, U any](slice1 []T, slice2 []U, comparator func(T, U) bool) bool
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/b9iygtgsHI1)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/b9iygtgsHI1)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -819,7 +818,7 @@ func main() {
|
||||
func Filter[T any](slice []T, predicate func(index int, item T) bool) []T
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/SdPna-7qK4T)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/SdPna-7qK4T)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -853,7 +852,7 @@ func main() {
|
||||
func Find[T any](slice []T, predicate func(index int, item T) bool) (*T, bool)
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/CBKeBoHVLgq)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/CBKeBoHVLgq)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -889,7 +888,7 @@ func main() {
|
||||
func FindBy[T any](slice []T, predicate func(index int, item T) bool) (v T, ok bool)
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/n1lysBYl-GB)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/n1lysBYl-GB)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -925,7 +924,7 @@ func main() {
|
||||
func FindLast[T any](slice []T, predicate func(index int, item T) bool) (*T, bool)
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/FFDPV_j7URd)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/FFDPV_j7URd)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -961,7 +960,7 @@ func main() {
|
||||
func FindLastBy[T any](slice []T, predicate func(index int, item T) bool) (v T, ok bool)
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/8iqomzyCl_s)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/8iqomzyCl_s)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -997,7 +996,7 @@ func main() {
|
||||
func Flatten(slice any) any
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/hYa3cBEevtm)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/hYa3cBEevtm)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -1027,7 +1026,7 @@ func main() {
|
||||
func FlattenDeep(slice any) any
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/yjYNHPyCFaF)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/yjYNHPyCFaF)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -1057,7 +1056,7 @@ func main() {
|
||||
func ForEach[T any](slice []T, iteratee func(index int, item T))
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/DrPaa4YsHRF)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/DrPaa4YsHRF)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -1092,7 +1091,7 @@ func main() {
|
||||
func ForEachWithBreak[T any](slice []T, iteratee func(index int, item T) bool)
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/qScs39f3D9W)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/qScs39f3D9W)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -1130,7 +1129,7 @@ func main() {
|
||||
func GroupBy[T any](slice []T, groupFn func(index int, item T) bool) ([]T, []T)
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/QVkPxzPR0iA)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/QVkPxzPR0iA)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -1166,7 +1165,7 @@ func main() {
|
||||
func GroupWith[T any, U comparable](slice []T, iteratee func(T) U) map[U][]T
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/ApCvMNTLO8a)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/ApCvMNTLO8a)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -1200,7 +1199,7 @@ func main() {
|
||||
func IntSlice(slice any) []int
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/UQDj-on9TGN)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/UQDj-on9TGN)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -1229,7 +1228,7 @@ func main() {
|
||||
func InterfaceSlice(slice any) []any
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/FdQXF0Vvqs-)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/FdQXF0Vvqs-)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -1258,7 +1257,7 @@ func main() {
|
||||
func Intersection[T comparable](slices ...[]T) []T
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/anJXfB5wq_t)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/anJXfB5wq_t)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -1289,7 +1288,7 @@ func main() {
|
||||
func InsertAt[T any](slice []T, index int, value any) []T
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/hMLNxPEGJVE)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/hMLNxPEGJVE)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -1329,7 +1328,7 @@ func main() {
|
||||
func IndexOf[T comparable](slice []T, item T) int
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/MRN1f0FpABb)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/MRN1f0FpABb)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -1362,7 +1361,7 @@ func main() {
|
||||
func LastIndexOf[T comparable](slice []T, item T) int
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/DokM4cf1IKH)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/DokM4cf1IKH)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -1395,7 +1394,7 @@ func main() {
|
||||
func Map[T any, U any](slice []T, iteratee func(index int, item T) U) []U
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/biaTefqPquw)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/biaTefqPquw)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -1429,7 +1428,7 @@ func main() {
|
||||
func FilterMap[T any, U any](slice []T, iteratee func(index int, item T) (U, bool)) []U
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/J94SZ_9MiIe)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/J94SZ_9MiIe)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -1466,7 +1465,7 @@ func main() {
|
||||
func FlatMap[T any, U any](slice []T, iteratee func(index int, item T) []U) []U
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/_QARWlWs1N_F)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/_QARWlWs1N_F)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -1499,7 +1498,7 @@ func main() {
|
||||
func Merge[T any](slices ...[]T) []T
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/lbjFp784r9N)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/lbjFp784r9N)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -1530,7 +1529,7 @@ func main() {
|
||||
func Reverse[T any](slice []T)
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/8uI8f1lwNrQ)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/8uI8f1lwNrQ)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -1560,7 +1559,7 @@ func main() {
|
||||
func Reduce[T any](slice []T, iteratee func(index int, item1, item2 T) T, initial T) T
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/_RfXJJWIsIm)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/_RfXJJWIsIm)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -1594,7 +1593,7 @@ func main() {
|
||||
func ReduceBy[T any, U any](slice []T, initial U, reducer func(index int, item T, agg U) U) U
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/YKDpLi7gtee)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/YKDpLi7gtee)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -1630,7 +1629,7 @@ func main() {
|
||||
func ReduceRight[T any, U any](slice []T, initial U, reducer func(index int, item T, agg U) U) U
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/qT9dZC03A1K)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/qT9dZC03A1K)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -1660,7 +1659,7 @@ func main() {
|
||||
func Replace[T comparable](slice []T, old T, new T, n int) []T
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/P5mZp7IhOFo)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/P5mZp7IhOFo)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -1702,7 +1701,7 @@ func main() {
|
||||
func ReplaceAll[T comparable](slice []T, old T, new T) []T
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/CzqXMsuYUrx)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/CzqXMsuYUrx)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -1730,7 +1729,7 @@ func main() {
|
||||
func Repeat[T any](item T, n int) []T
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/1CbOmtgILUU)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/1CbOmtgILUU)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -1758,7 +1757,7 @@ func main() {
|
||||
func Shuffle[T any](slice []T) []T
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/YHvhnWGU3Ge)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/YHvhnWGU3Ge)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -1787,7 +1786,7 @@ func main() {
|
||||
func IsAscending[T constraints.Ordered](slice []T) bool
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/9CtsFjet4SH)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/9CtsFjet4SH)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -1821,7 +1820,7 @@ func main() {
|
||||
func IsDescending[T constraints.Ordered](slice []T) bool
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/U_LljFXma14)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/U_LljFXma14)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -1855,7 +1854,7 @@ func main() {
|
||||
func IsSorted[T constraints.Ordered](slice []T) bool
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/nCE8wPLwSA-)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/nCE8wPLwSA-)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -1889,7 +1888,7 @@ func main() {
|
||||
func IsSortedByKey[T any, K constraints.Ordered](slice []T, iteratee func(item T) K) bool
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/tUoGB7DOHI4)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/tUoGB7DOHI4)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -1929,7 +1928,7 @@ func main() {
|
||||
func Sort[T constraints.Ordered](slice []T, sortOrder ...string)
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/V9AVjzf_4Fk)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/V9AVjzf_4Fk)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -1966,7 +1965,7 @@ func main() {
|
||||
func SortBy[T any](slice []T, less func(a, b T) bool)
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/DAhLQSZEumm)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/DAhLQSZEumm)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -2013,7 +2012,7 @@ func main() {
|
||||
func SortByField(slice any, field string, sortType ...string) error
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/fU1prOBP9p1)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/fU1prOBP9p1)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -2054,7 +2053,7 @@ func main() {
|
||||
func Some[T any](slice []T, predicate func(index int, item T) bool) bool
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/4pO9Xf9NDGS)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/4pO9Xf9NDGS)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -2088,7 +2087,7 @@ func main() {
|
||||
func StringSlice(slice any) []string
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/W0TZDWCPFcI)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/W0TZDWCPFcI)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -2117,7 +2116,7 @@ func main() {
|
||||
func SymmetricDifference[T comparable](slices ...[]T) []T
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/1CbOmtgILUU)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/1CbOmtgILUU)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -2148,7 +2147,7 @@ func main() {
|
||||
func ToSlice[T any](items ...T) []T
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/YzbzVq5kscN)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/YzbzVq5kscN)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -2176,7 +2175,7 @@ func main() {
|
||||
func ToSlicePointer[T any](items ...T) []*T
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/gx4tr6_VXSF)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/gx4tr6_VXSF)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -2211,7 +2210,7 @@ func main() {
|
||||
func Unique[T comparable](slice []T) []T
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/AXw0R3ZTE6a)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/AXw0R3ZTE6a)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -2238,7 +2237,7 @@ func main() {
|
||||
func UniqueBy[T comparable](slice []T, iteratee func(item T) T) []T
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/UR323iZLDpv)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/UR323iZLDpv)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -2269,7 +2268,7 @@ func main() {
|
||||
func Union[T comparable](slices ...[]T) []T
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/hfXV1iRIZOf)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/hfXV1iRIZOf)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -2300,7 +2299,7 @@ func main() {
|
||||
func UnionBy[T any, V comparable](predicate func(item T) V, slices ...[]T) []T
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/HGKHfxKQsFi)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/HGKHfxKQsFi)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -2333,7 +2332,7 @@ func main() {
|
||||
func UpdateAt[T any](slice []T, index int, value T) []T
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/f3mh2KloWVm)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/f3mh2KloWVm)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -2373,7 +2372,7 @@ func main() {
|
||||
func Without[T comparable](slice []T, items ...T) []T
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/bwhEXEypThg)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/bwhEXEypThg)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -2401,7 +2400,7 @@ func main() {
|
||||
func KeyBy[T any, U comparable](slice []T, iteratee func(item T) U) map[U]T
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/uXod2LWD1Kg)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/uXod2LWD1Kg)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -2431,7 +2430,7 @@ func main() {
|
||||
func Join[T any](s []T, separator string) string
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/huKzqwNDD7V)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/huKzqwNDD7V)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
|
||||
@@ -51,8 +51,6 @@ import (
|
||||
|
||||
<div STYLE="page-break-after: always;"></div>
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="/styles/api_doc.css">
|
||||
|
||||
## 文档
|
||||
|
||||
### <span id="Of">Of</span>
|
||||
@@ -65,7 +63,7 @@ import (
|
||||
func Of[T any](elems ...T) stream[T]
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/jI6_iZZuVFE)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/jI6_iZZuVFE)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -95,7 +93,7 @@ func main() {
|
||||
func FromSlice[T any](source []T) stream[T]
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/wywTO0XZtI4)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/wywTO0XZtI4)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -125,7 +123,7 @@ func main() {
|
||||
func FromChannel[T any](source <-chan T) stream[T]
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/9TZYugGMhXZ)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/9TZYugGMhXZ)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -163,7 +161,7 @@ func main() {
|
||||
func FromRange[T constraints.Integer | constraints.Float](start, end, step T) stream[T]
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/9Ex1-zcg-B-)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/9Ex1-zcg-B-)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -192,7 +190,7 @@ func main() {
|
||||
func Generate[T any](generator func() func() (item T, ok bool)) stream[T]
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/rkOWL1yA3j9)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/rkOWL1yA3j9)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -232,7 +230,7 @@ func main() {
|
||||
func Concat[T any](a, b stream[T]) stream[T]
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/HM4OlYk_OUC)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/HM4OlYk_OUC)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -265,7 +263,7 @@ func main() {
|
||||
func (s stream[T]) Distinct() stream[T]
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/eGkOSrm64cB)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/eGkOSrm64cB)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -299,7 +297,7 @@ func main() {
|
||||
func (s stream[T]) Filter(predicate func(item T) bool) stream[T]
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/MFlSANo-buc)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/MFlSANo-buc)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -333,7 +331,7 @@ func main() {
|
||||
func (s stream[T]) Map(mapper func(item T) T) stream[T]
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/OtNQUImdYko)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/OtNQUImdYko)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -367,7 +365,7 @@ func main() {
|
||||
func (s stream[T]) Peek(consumer func(item T)) stream[T]
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/u1VNzHs6cb2)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/u1VNzHs6cb2)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -404,7 +402,7 @@ func main() {
|
||||
func (s stream[T]) Skip(n int) stream[T]
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/fNdHbqjahum)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/fNdHbqjahum)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -443,7 +441,7 @@ func main() {
|
||||
func (s stream[T]) Limit(maxSize int) stream[T]
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/qsO4aniDcGf)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/qsO4aniDcGf)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -482,7 +480,7 @@ func main() {
|
||||
func (s stream[T]) Reverse() stream[T]
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/A8_zkJnLHm4)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/A8_zkJnLHm4)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -512,7 +510,7 @@ func main() {
|
||||
func (s stream[T]) Range(start, end int) stream[T]
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/indZY5V2f4j)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/indZY5V2f4j)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -551,7 +549,7 @@ func main() {
|
||||
func (s stream[T]) Sorted(less func(a, b T) bool) stream[T]
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/XXtng5uonFj)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/XXtng5uonFj)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -583,7 +581,7 @@ func main() {
|
||||
func (s stream[T]) ForEach(action func(item T))
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/Dsm0fPqcidk)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/Dsm0fPqcidk)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -616,7 +614,7 @@ func main() {
|
||||
func (s stream[T]) Reduce(initial T, accumulator func(a, b T) T) T
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/6uzZjq_DJLU)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/6uzZjq_DJLU)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -648,7 +646,7 @@ func main() {
|
||||
func (s stream[T]) FindFirst() (T, bool)
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/9xEf0-6C1e3)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/9xEf0-6C1e3)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -680,7 +678,7 @@ func main() {
|
||||
func (s stream[T]) FindLast() (T, bool)
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/WZD2rDAW-2h)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/WZD2rDAW-2h)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -712,7 +710,7 @@ func main() {
|
||||
func (s stream[T]) Max(less func(a, b T) bool) (T, bool)
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/fm-1KOPtGzn)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/fm-1KOPtGzn)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -744,7 +742,7 @@ func main() {
|
||||
func (s stream[T]) Min(less func(a, b T) bool) (T, bool)
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/vZfIDgGNRe_0)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/vZfIDgGNRe_0)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -776,7 +774,7 @@ func main() {
|
||||
func (s stream[T]) AllMatch(predicate func(item T) bool) bool
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/V5TBpVRs-Cx)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/V5TBpVRs-Cx)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -814,7 +812,7 @@ func main() {
|
||||
func (s stream[T]) AnyMatch(predicate func(item T) bool) bool
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/PTCnWn4OxSn)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/PTCnWn4OxSn)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -852,7 +850,7 @@ func main() {
|
||||
func (s stream[T]) NoneMatch(predicate func(item T) bool) bool
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/iWS64pL1oo3)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/iWS64pL1oo3)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -890,7 +888,7 @@ func main() {
|
||||
func (s stream[T]) Count() int
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/r3koY6y_Xo-)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/r3koY6y_Xo-)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -921,7 +919,7 @@ func main() {
|
||||
func (s stream[T]) ToSlice() []T
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/jI6_iZZuVFE)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/jI6_iZZuVFE)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
|
||||
@@ -62,8 +62,6 @@ import (
|
||||
|
||||
<div STYLE="page-break-after: always;"></div>
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="/styles/api_doc.css">
|
||||
|
||||
## 文档
|
||||
|
||||
### <span id="After">After</span>
|
||||
@@ -76,7 +74,7 @@ import (
|
||||
func After(s, char string) string
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/RbCOQqCDA7m)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/RbCOQqCDA7m)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -116,7 +114,7 @@ func main() {
|
||||
func AfterLast(s, char string) string
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/1TegARrb8Yn)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/1TegARrb8Yn)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -156,7 +154,7 @@ func main() {
|
||||
func Before(s, char string) string
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/JAWTZDS4F5w)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/JAWTZDS4F5w)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -193,7 +191,7 @@ func main() {
|
||||
func BeforeLast(s, char string) string
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/pJfXXAoG_Te)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/pJfXXAoG_Te)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -230,7 +228,7 @@ func main() {
|
||||
func CamelCase(s string) string
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/9eXP3tn2tUy)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/9eXP3tn2tUy)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -265,7 +263,7 @@ func main() {
|
||||
func KebabCase(s string) string
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/dcZM9Oahw-Y)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/dcZM9Oahw-Y)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -300,7 +298,7 @@ func main() {
|
||||
func UpperKebabCase(s string) string
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/zDyKNneyQXk)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/zDyKNneyQXk)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -335,7 +333,7 @@ func main() {
|
||||
func Capitalize(s string) string
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/2OAjgbmAqHZ)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/2OAjgbmAqHZ)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -370,7 +368,7 @@ func main() {
|
||||
func IsString(v any) bool
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/IOgq7oF9ERm)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/IOgq7oF9ERm)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -410,7 +408,7 @@ func main() {
|
||||
func LowerFirst(s string) string
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/CbzAyZmtJwL)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/CbzAyZmtJwL)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -444,7 +442,7 @@ func main() {
|
||||
func UpperFirst(s string) string
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/sBbBxRbs8MM)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/sBbBxRbs8MM)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -478,7 +476,7 @@ func main() {
|
||||
func Pad(source string, size int, padStr string) string
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/NzImQq-VF8q)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/NzImQq-VF8q)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -523,7 +521,7 @@ func main() {
|
||||
func PadEnd(source string, size int, padStr string) string
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/9xP8rN0vz--)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/9xP8rN0vz--)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -569,7 +567,7 @@ func main() {
|
||||
func PadStart(source string, size int, padStr string) string
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/xpTfzArDfvT)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/xpTfzArDfvT)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -615,7 +613,7 @@ func main() {
|
||||
func Reverse(s string) string
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/adfwalJiecD)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/adfwalJiecD)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -646,7 +644,7 @@ func main() {
|
||||
func SnakeCase(s string) string
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/tgzQG11qBuN)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/tgzQG11qBuN)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -681,7 +679,7 @@ func main() {
|
||||
func UpperSnakeCase(s string) string
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/4COPHpnLx38)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/4COPHpnLx38)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -716,7 +714,7 @@ func main() {
|
||||
func SplitEx(s, sep string, removeEmptyString bool) []string
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/Us-ySSbWh-3)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/Us-ySSbWh-3)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -757,7 +755,7 @@ func main() {
|
||||
func Substring(s string, offset int, length uint) string
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/q3sM6ehnPDp)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/q3sM6ehnPDp)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -800,7 +798,7 @@ func main() {
|
||||
func Wrap(str string, wrapWith string) string
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/KoZOlZDDt9y)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/KoZOlZDDt9y)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -837,7 +835,7 @@ func main() {
|
||||
func Unwrap(str string, wrapToken string) string
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/Ec2q4BzCpG-)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/Ec2q4BzCpG-)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -877,7 +875,7 @@ func main() {
|
||||
func SplitWords(s string) []string
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/KLiX4WiysMM)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/KLiX4WiysMM)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -920,7 +918,7 @@ func main() {
|
||||
func WordCount(s string) int
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/bj7_odx3vRf)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/bj7_odx3vRf)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -963,7 +961,7 @@ func main() {
|
||||
func RemoveNonPrintable(str string) string
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/og47F5x_jTZ)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/og47F5x_jTZ)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -994,7 +992,7 @@ func main() {
|
||||
func StringToBytes(str string) (b []byte)
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/7OyFBrf9AxA)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/7OyFBrf9AxA)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -1024,7 +1022,7 @@ func main() {
|
||||
func BytesToString(bytes []byte) string
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/6c68HRvJecH)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/6c68HRvJecH)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -1053,7 +1051,7 @@ func main() {
|
||||
func IsBlank(str string) bool
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/6zXRH_c0Qd3)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/6zXRH_c0Qd3)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -1087,7 +1085,7 @@ func main() {
|
||||
func HasPrefixAny(str string, prefixes []string) bool
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/8UUTl2C5slo)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/8UUTl2C5slo)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -1118,7 +1116,7 @@ func main() {
|
||||
func HasSuffixAny(str string, suffixes []string) bool
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/sKWpCQdOVkx)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/sKWpCQdOVkx)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -1149,7 +1147,7 @@ func main() {
|
||||
func IndexOffset(str string, substr string, idxFrom int) int
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/qZo4lV2fomB)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/qZo4lV2fomB)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -1191,7 +1189,7 @@ func main() {
|
||||
func ReplaceWithMap(str string, replaces map[string]string) string
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/h3t7CNj2Vvu)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/h3t7CNj2Vvu)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -1224,7 +1222,7 @@ func main() {
|
||||
func Trim(str string, characterMask ...string) string
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/Y0ilP0NRV3j)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/Y0ilP0NRV3j)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -1261,7 +1259,7 @@ func main() {
|
||||
func SplitAndTrim(str, delimiter string, characterMask ...string) []string
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/ZNL6o4SkYQ7)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/ZNL6o4SkYQ7)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -1294,7 +1292,7 @@ func main() {
|
||||
func HideString(origin string, start, end int, replaceChar string) string
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/pzbaIVCTreZ)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/pzbaIVCTreZ)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -1333,7 +1331,7 @@ func main() {
|
||||
func ContainsAll(str string, substrs []string) bool
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/KECtK2Os4zq)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/KECtK2Os4zq)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -1366,7 +1364,7 @@ func main() {
|
||||
func ContainsAny(str string, substrs []string) bool
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/dZGSSMB3LXE)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/dZGSSMB3LXE)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
@@ -1402,7 +1400,7 @@ func main() {
|
||||
func RemoveWhiteSpace(str string, repalceAll bool) string
|
||||
```
|
||||
|
||||
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/HzLC9vsTwkf)</span></b>
|
||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/HzLC9vsTwkf)</span></b>
|
||||
|
||||
```go
|
||||
import (
|
||||
|
||||
Reference in New Issue
Block a user