Re:Channels in Golang
by pcwalton on Sunday December 25, 2016 @03:48PM
(#13255373)
> Aren't Go structs subtypes of every interface they conform to?
No. There's a defined coercion between values and interface types, which is not the same thing as subtyping. This affects the semantics: for example, you can't pass a value of type []MyStruct to a function taking []interface{}.
No. There's a defined coercion between values and interface types, which is not the same thing as subtyping. This affects the semantics: for example, you can't pass a value of type []MyStruct to a function taking []interface{}.