Y
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
frou_dh
3288 days ago
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
link
https://github.com/BurntSushi/go-sumtype