Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- func p(s []int) {
- fmt.Println(s, len(s), cap(s))
- }
- func main() {
- f := make([]int, 2, 4)
- h := f[:]
- f = append(f, 11)
- h = append(h, 22)
- f = append(f, 33)
- f = append(f, 44)
- p(f)
- p(h)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement