Go Replaces Interface{} with 'Any'
github.com
Go Replaces Interface{} with 'Any'
1–10 of 481 posts
Re: Go Replaces Interface{} with 'Any'
#2Re: Go Replaces Interface{} with 'Any'
#3It's a type alias, introduced for generics. By the way, Go 1.18 Beta 1 is released (with generics): https://groups.google.com/g/golang-announce/c/eAjK4Oezs_A
Edit: I’m impressed generics aren’t a breaking change! I thought this changed Interface{} to Any as a breaking change
Re: Go Replaces Interface{} with 'Any'
#4It's a type alias, introduced for generics. By the way, Go 1.18 Beta 1 is released (with generics): https://groups.google.com/g/golang-announce/c/eAjK4Oezs_A
How is generics not a big enough change to warrant 2.0? Edit: I’m impressed generics aren’t a breaking change! I thought this changed Interface{} to Any as a breaking change
Re: Go Replaces Interface{} with 'Any'
#5It's a type alias, introduced for generics. By the way, Go 1.18 Beta 1 is released (with generics): https://groups.google.com/g/golang-announce/c/eAjK4Oezs_A
For the release announcement: https://news.ycombinator.com/item?id=29556646
Re: Go Replaces Interface{} with 'Any'
#6It's a type alias, introduced for generics. By the way, Go 1.18 Beta 1 is released (with generics): https://groups.google.com/g/golang-announce/c/eAjK4Oezs_A
How is generics not a big enough change to warrant 2.0? Edit: I’m impressed generics aren’t a breaking change! I thought this changed Interface{} to Any as a breaking change
Re: Go Replaces Interface{} with 'Any'
#7It's a type alias, introduced for generics. By the way, Go 1.18 Beta 1 is released (with generics): https://groups.google.com/g/golang-announce/c/eAjK4Oezs_A
How is generics not a big enough change to warrant 2.0? Edit: I’m impressed generics aren’t a breaking change! I thought this changed Interface{} to Any as a breaking change
Re: Go Replaces Interface{} with 'Any'
#8It's a type alias, introduced for generics. By the way, Go 1.18 Beta 1 is released (with generics): https://groups.google.com/g/golang-announce/c/eAjK4Oezs_A
AFAICT, its usage is not restricted to generics. It seems to be suggested to use anywhere you would use interface{}. For the release announcement: https://news.ycombinator.com/item?id=29556646
So an unbounded type parameter is [T interface{}], or [T any] when using the shorter alias. It's a type alias / predeclared identifier defined in the universe scope:
type any = interface{}