hasheddan / danielmangum.com

3 stars 2 forks source link

[Post] An Annoying Attribute of Golang Interfaces #348

Open hasheddan opened 11 months ago

hasheddan commented 11 months ago

When the type is assigned, the interface is non-nil, even if the underlying value is nil. This is especially frustrating when you wrap a function that returns a concrete type in one that returns an interface.

https://go.dev/play/p/uwSeDjq3SWP