- Sort Score
- Result 10 results
- Languages All
Results 1 - 1 of 1 for checkClearMap (0.2 sec)
-
test/clear.go
import "math" func checkClearSlice() { s := []int{1, 2, 3} clear(s) for i := range s { if s[i] != 0 { panic("clear not zeroing slice elem") } } clear([]int{}) } func checkClearMap() { m1 := make(map[int]int) m1[0] = 0 m1[1] = 1 clear(m1) if len(m1) != 0 { panic("m1 is not cleared") } // map contains NaN keys is also cleared. m2 := make(map[float64]int)
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Jan 31 19:43:07 UTC 2023 - 743 bytes - Viewed (0)