- Sort Score
- Result 10 results
- Languages All
Results 1 - 2 of 2 for ExampleEqual (0.2 sec)
-
src/maps/example_test.go
"two": 2, "three": 3, "four": 4, } maps.DeleteFunc(m, func(k string, v int) bool { return v%2 != 0 // delete odd values }) fmt.Println(m) // Output: // map[four:4 two:2] } func ExampleEqual() { m1 := map[int]string{ 1: "one", 10: "Ten", 1000: "THOUSAND", } m2 := map[int]string{ 1: "one", 10: "Ten", 1000: "THOUSAND", } m3 := map[int]string{
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed Oct 11 20:21:56 UTC 2023 - 2.2K bytes - Viewed (0) -
src/slices/example_test.go
seq := []int{0, 1, 1, 2, 3, 5, 8} seq = slices.DeleteFunc(seq, func(n int) bool { return n%2 != 0 // delete the odd numbers }) fmt.Println(seq) // Output: // [0 2 8] } func ExampleEqual() { numbers := []int{0, 42, 8} fmt.Println(slices.Equal(numbers, []int{0, 42, 8})) fmt.Println(slices.Equal(numbers, []int{10})) // Output: // true // false } func ExampleEqualFunc() {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri May 10 17:28:50 UTC 2024 - 8.1K bytes - Viewed (0)