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:
@@ -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
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user