4 ms·
Why? You can easily call NewUsername inside NewAccount for example, just return the error. Or did I misunderstood?
by mrklol 3y ago
Why? You can easily call NewUsername inside NewAccount for example, just return the error. Or did I misunderstood?
- BreakfastB0b 3y agoBecause go doesn’t have exhaustiveness checking when initialising structs. Instead it encourages “make the zero value meaningful” which is not always possible nor desirable. I usually use a linter to catch this kind of problem https://github.com/GaijinEntertainment/go-exhaustruct https://github.com/GaijinEntertainment/go-exhaustruct
- vorticalbox 3y agoI like this but in the examples would volume be calculated by width/length rather than being set?