Re: [go-nuts] Interface definition as type alias

2020-09-08 Thread 'Axel Wagner' via golang-nuts
The only real downsides, I think, are that compiler errors gets harder to read: https://github.com/golang/go/issues/21866 And likewise, that the name won't appear at runtime, so if you print things using `reflect`, the result will be less readable. I think there are cases where it has advantages,

[go-nuts] Interface definition as type alias

2020-09-08 Thread 'Javier Zunzunegui' via golang-nuts
TLDR: Why should I NOT the alias form `type ... = interface {...}` instead of the standard `type ... interface {...}` for interface declarations? The extended question: The normal type definition for an interface in go would be `type TypeName interface {...}`. This results in a new type, which