3 ms·
A Sneaky Golang Bug
- sophiabits 3y agoIn C++ there’s an attribute called nodiscard which solves this problem assuming the API you’re consuming is written well. When you apply this attribute to a function, the compiler emits a warning when that function’s return value isn’t used by the developer [1]. Lots of other languages take the same approach. Rust’s must_use attribute is basically the same as nodiscard. It’s a nice way of solving the problem imo. [1] https://en.cppreference.com/w/cpp/language/attributes/nodiscard https://en.cppreference.com/w/cpp/language/attributes/nodisc...
- latchkey 3y agoA unit test would have caught this.