1
0
mirror of https://github.com/duke-git/lancet.git synced 2026-02-08 14:42:27 +08:00

doc: normalize documents

This commit is contained in:
dudaodong
2023-01-12 15:44:34 +08:00
parent 9ffe96d3ef
commit c260ce493d
12 changed files with 1883 additions and 1453 deletions

View File

@@ -61,8 +61,6 @@ func main() {
}
```
### <span id="Bridge">Bridge</span>
<p>Link multiple channels into one channel until cancel the context.</p>
@@ -105,6 +103,7 @@ func main() {
for v := range c.Bridge(ctx, genVals()) {
fmt.Println(v)
}
// Output:
// 1
// 2
@@ -114,9 +113,6 @@ func main() {
}
```
### <span id="FanIn">FanIn</span>
<p>Merge multiple channels into one channel until cancel the context.</p>
@@ -156,7 +152,6 @@ func main() {
}
```
### <span id="Repeat">Repeat</span>
<p>Create channel, put values into the channel repeatly until cancel the context.</p>
@@ -187,6 +182,7 @@ func main() {
for v := range intStream {
fmt.Println(v)
}
// Output:
// 1
// 2
@@ -195,8 +191,6 @@ func main() {
}
```
### <span id="Generate">Generate</span>
<p>Creates a channel, then put values into the channel.</p>
@@ -269,6 +263,7 @@ func main() {
for v := range intStream {
fmt.Println(v)
}
// Output:
// hello
// hello
@@ -276,8 +271,6 @@ func main() {
}
```
### <span id="Or">Or</span>
<p>Read one or more channels into one channel, will close when any readin channel is closed.</p>
@@ -321,9 +314,6 @@ func main() {
}
```
### <span id="OrDone">OrDone</span>
<p>Read a channel into another channel, will close until cancel context.</p>
@@ -354,6 +344,7 @@ func main() {
for v := range c.OrDone(ctx, intStream) {
fmt.Println(v)
}
// Output:
// 1
// 1
@@ -361,9 +352,6 @@ func main() {
}
```
### <span id="Take">Take</span>
<p>Create a channel whose values are taken from another channel with limit number.</p>
@@ -402,6 +390,7 @@ func main() {
for v := range intStream {
fmt.Println(v)
}
// Output:
// 1
// 2
@@ -409,8 +398,6 @@ func main() {
}
```
### <span id="Tee">Tee</span>
<p>Split one chanel into two channels, until cancel the context.</p>
@@ -444,6 +431,7 @@ func main() {
fmt.Println(v)
fmt.Println(<-ch2)
}
// Output:
// 1
// 1