mirror of
https://github.com/duke-git/lancet.git
synced 2026-02-09 23:22:28 +08:00
doc: update doc styles
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user