Hacker News new | past | comments | ask | show | jobs | submit login

The sibling comment did a great job of distilling down a reflect-free case of how you might get yourself into this situation.

In part, the reason I modeled it the way I did was because it was the way I discovered what was going on, but also because it shows what exactly is going on under the hood (and why nil, isn't).

It's not inconceivable to get yourself into this case if you're not careful with e.g. scanning variables into interfaces using the sql package. In this case, the machinery produced a semantically correct result (a typed nil), but the result is not very idiomatic in Go.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: