mirror of
https://github.com/duke-git/lancet.git
synced 2026-02-17 03:02:28 +08:00
doc: format code in markdown file
This commit is contained in:
@@ -101,8 +101,6 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
assert := internal.NewAssert(t, "TestBefore")
|
|
||||||
|
|
||||||
arr := []string{"a", "b", "c", "d", "e"}
|
arr := []string{"a", "b", "c", "d", "e"}
|
||||||
f := function.Before(3, func(i int) int {
|
f := function.Before(3, func(i int) int {
|
||||||
return i
|
return i
|
||||||
@@ -120,7 +118,7 @@ func main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
expected := []int64{0, 1, 2, 2, 2}
|
expected := []int64{0, 1, 2, 2, 2}
|
||||||
assert.Equal(expected, res)
|
fmt.Println(res) // 0, 1, 2, 2, 2
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -101,8 +101,6 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
assert := internal.NewAssert(t, "TestBefore")
|
|
||||||
|
|
||||||
arr := []string{"a", "b", "c", "d", "e"}
|
arr := []string{"a", "b", "c", "d", "e"}
|
||||||
f := function.Before(3, func(i int) int {
|
f := function.Before(3, func(i int) int {
|
||||||
return i
|
return i
|
||||||
@@ -119,8 +117,7 @@ func main() {
|
|||||||
appendStr(i, arr[i], f)
|
appendStr(i, arr[i], f)
|
||||||
}
|
}
|
||||||
|
|
||||||
expected := []int64{0, 1, 2, 2, 2}
|
fmt.Println(res) // 0, 1, 2, 2, 2
|
||||||
assert.Equal(expected, res)
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -297,7 +294,7 @@ func main() {
|
|||||||
time.Sleep(5 * time.Second)
|
time.Sleep(5 * time.Second)
|
||||||
close(stop)
|
close(stop)
|
||||||
|
|
||||||
fmt.Println(res) //[* * * * *]
|
fmt.Println(res) //[* * * * *]
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user