c is of type *Count (pointer to Count), surely? It is (*c) that is of type Count, which has to be cast to int to be returned as such because Go requires explicit casts. Agree with the rest.
On Friday, June 19, 2020 at 12:44:26 PM UTC-5, Tyler Compton wrote: > > In this case, c is of type Count, not int. When you define a type in Go, > you're defining a new distinct type, not an alias to the underlying type. > The Count type is distinct from int, even though it's based on int. > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/3f2b4f42-7ece-427e-b399-22b2d0145234o%40googlegroups.com.