2 ms·
How does this affect performance? Maybe sticking with switch statements and writing a linter of some sort to do exhaustiveness checks would be a better idea?
by skybrian 5y ago
How does this affect performance? Maybe sticking with switch statements and writing a linter of some sort to do exhaustiveness checks would be a better idea?
- lawrjone 5y agoI should say, we have absolutely no performance requirements, at least in terms of what this will do. If we could add 10% developer efficiency for 20% performance hit, we'd take that in a heartbeat. The nanoseconds this construct might cost are just irrelevant to us, our customers, or our bottomline. Obviously if you're writing some low-level performance sensitive code then this won't be free, but I expect most people are in our situation.
- wlamartin 5y agoSuch a thing exists: https://github.com/BurntSushi/go-sumtype https://github.com/BurntSushi/go-sumtype