tour icon indicating copy to clipboard operation
tour copied to clipboard

tour: Suggestion: Add a page or two for how to do enums the Go way (for devs coming from other languages)

Open JamesC01 opened this issue 11 months ago • 0 comments

Context: https://go.dev/tour/moretypes/

I think it would be really beneficial to describe the idiomatic Go way of doing something like enums from other languages, (using constants wrapped in (), or using iota, using both of those with a custom type etc.) I searched for a bit, and it seems like there isn't a single official Go resource mentioning that these are the alternative to using enums, I only found third-party articles and stackoverflow questions, so I think it would be very beneficial to add one or two pages to the tour in the "moretypes" section explaining how you do this in Go, for people who are coming from other languages. I only just started learning Go yesterday, so I'm not sure how to write a page, so hopefully someone who knows their stuff can.

JamesC01 avatar Feb 26 '24 09:02 JamesC01