[go-nuts] Puzzle for golang guru.

2017-02-16 Thread DV
Very subtle fix: https://play.golang.org/p/xTEGpgIyP6 -- 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,

[go-nuts] Puzzle for golang guru.

2017-02-16 Thread DV
Very subtle fix: https://play.golang.org/p/xTEGpgIyP6 -- 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,

Re: [go-nuts] Puzzle for golang guru.

2017-02-16 Thread Rob Pike
https://golang.org/doc/faq#nil_error On Thu, Feb 16, 2017 at 12:38 AM, dreyk wrote: > What do you expect as output of following code? > > package main > > import "fmt" > > type MyInterface interface { >GetName() string > } > type MyInterfaceImpl struct { >Name string > } > func (

[go-nuts] Puzzle for golang guru.

2017-02-16 Thread dreyk
What do you expect as output of following code? package main import "fmt" type MyInterface interface { GetName() string } type MyInterfaceImpl struct { Name string } func (i *MyInterfaceImpl) GetName() string { return i.Name } func getNilMyInterface() MyInterface { re