3 ms·
Yup! Type assertions work this way too. It's a much nicer design than traditional casts.
by brandonbloom 9y ago
Yup! Type assertions work this way too. It's a much nicer design than traditional casts.
- frou_dh 9y agoCheck 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 https://github.com/BurntSushi/go-sumtype