1
0
mirror of https://github.com/duke-git/lancet.git synced 2026-03-01 00:35:28 +08:00

docs: fix code format

This commit is contained in:
dudaodong
2022-06-06 11:12:53 +08:00
parent 11d86d0270
commit 56d1e5e95c

View File

@@ -293,8 +293,8 @@ import (
func main() { func main() {
set1 := set.NewSet(1, 2, 3) set1 := set.NewSet(1, 2, 3)
set2 := set.NewSet(1, 2, 3) set2 := set.NewSet(1, 2, 3)
set3 := set.NewSet(1, 2, 3, 4) set3 := set.NewSet(1, 2, 3, 4)
fmt.Println(set1.Equal(set2)) //true fmt.Println(set1.Equal(set2)) //true
fmt.Println(set1.Equal(set3)) //false fmt.Println(set1.Equal(set3)) //false
@@ -323,10 +323,10 @@ import (
func main() { func main() {
set1 := set.NewSet(1, 2, 3) set1 := set.NewSet(1, 2, 3)
arr := []int{} arr := []int{}
set.Iterate(func(value int) { set.Iterate(func(value int) {
arr = append(arr, value) arr = append(arr, value)
}) })
fmt.Println(arr) //1,2,3 fmt.Println(arr) //1,2,3
} }
@@ -383,8 +383,8 @@ import (
func main() { func main() {
set1 := set.NewSet(1, 2, 3) set1 := set.NewSet(1, 2, 3)
set2 := set.NewSet(2, 3, 4, 5) set2 := set.NewSet(2, 3, 4, 5)
set3 := set1.Union(set2) set3 := set1.Union(set2)
fmt.Println(set3.Values()) //1,2,3,4,5 fmt.Println(set3.Values()) //1,2,3,4,5
} }
@@ -412,8 +412,8 @@ import (
func main() { func main() {
set1 := set.NewSet(1, 2, 3) set1 := set.NewSet(1, 2, 3)
set2 := set.NewSet(2, 3, 4, 5) set2 := set.NewSet(2, 3, 4, 5)
set3 := set1.Intersection(set2) set3 := set1.Intersection(set2)
fmt.Println(set3.Values()) //2,3 fmt.Println(set3.Values()) //2,3
} }