I am not sure what exactly is the issue you are complaining about. You can think of interface as a container for some data type. The container can be nil and the data contained in it can be nil. This looks reasonable to me as much as having a C++ vector that contains nil (well, nullptr) pointers.
On Tue, Oct 31, 2017 at 9:33 AM <oju...@gmail.com> wrote: > Ian, with all due respect, I beg to differ. > > Let's look at that example posted 5 years back: > > http://play.golang.org/p/Isoo0CcAvr > > Yes, that is the proper behavior according to the rules, we have a FAQ > entry, fine, but ... put simply: that makes no sense. Why? Because we, the > users, expect the code to work the other way. That is a big surprise and we > don't need the tool creating surprises for us, much to the contrary. > > The internal layout Go uses to store an interface should not mess with the > expected behavior. If interface is two separate fields, or just a pointer, > or refers to a bitmap stored on the Moon, I don't care. I shouldn't care. > The fact that today we must tell every new Go user this whole story is a > shame. Go is meant to be easy, after all. > > The behavior of a software of mine is not what my user expect? In my book > that means I have a bug. Even with a very reasonable explanation, that > remains a bug. I can spend hours explaining a strange behavior to my user. > He will tell me: "Oh, yes. Now I got it, thanks. Fix that". > > That reminds me of an old adage: > “If the map doesn't agree with the ground the map is wrong” > I sincerely hope Go 2 will have it fixed. > > -- > You received this message because you are subscribed to the Google Groups > "golang-nuts" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to golang-nuts+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.