nil before using the slice? Why is that better
Btw if you do len(array) it will return 0 if array is nil or has zero length So in checking, they are not different
Can I append to nil slice?
If you are using built-in method append, then yes In this manner: array = append(array, ...)
no. You can append into nil slices
Обсуждают сегодня