4 ms·
Access on an empty slice would also panic because of out of bounds. So there’s no useful distinction there. However, nil slices work just fine when calling app
by mxey 2y ago
Access on an empty slice would also panic because of out of bounds. So there’s no useful distinction there.
However, nil slices work just fine when calling append on them, while writing to a nil map in any way will panic.