size
size copied to clipboard
The size of variable at runtime
Not sure if client code should implement the right locking or this can be done in this package. ``` fatal error: concurrent map read and map write goroutine 17031842 [running]:...
Fix for: #16, #7
cnt := 1000 ss := make([][]string, cnt, cnt) // len = cap = 1000 s := make([]string, 1, 1) // len = cap = 1 : slice header = 24...
If you have a struct ``` struct { a, b []int } ``` and you set `mystruct.a = []int{1,2,3, ...., 100000}` and `mystruct.b = mystruct.a`, then the memory taken by...