FAQ
I put together a little program demonstrating that you can do quite a few
things with a nil slice, map, or channel:

http://play.golang.org/p/fOSFNrGJwT

As you can see, pretty much all applicable operation are legal (and produce
the expected result). The two exceptions are writing to a nil map and
closing a nil channel. I assume those two are forbidden since they would
have to allocate memory.

--

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedJan 20, '13 at 10:59p
activeJan 20, '13 at 10:59p
posts1
users1
websitegolang.org

1 user in discussion

Stefan Nilsson: 1 post

People

Translate

site design / logo © 2021 Grokbase