Hacker News new | ask | show | jobs
by brandonbloom 3289 days ago
Yup! Type assertions work this way too. It's a much nicer design than traditional casts.
1 comments

Check this out. With this tool, the type switch gets you exhaustiveness checks for hokey package-private sum-types in Go :)

https://github.com/BurntSushi/go-sumtype