/explore

Click through on any links that interest you or select the planets on the right to continue exploring the Outer Web.
You are here

b.yuxuan.org
| | blog.carlana.net

Graceful error handling in Go
17.5 parsecs

Travel
| |
| | hypothesis.works

The Encode/Decode invariant One of the simplest types of invariant to find once you move past just fuzzing your code is asserting that two different operations should produce the same result, and one of the simplest instances of that is looking for encode/decode pairs. That is, you have some function that takes a value and encodes it as another value, and another that is supposed to reverse the process. This is ripe for testing with Hypothesis because it has a natural completely defined specification: Encoding and then decoding should be exactly the same as doing nothing. Lets look at a concrete example. Test faster, fix more
24.6 parsecs

Travel
| |
| | paul.totterman.name

Go error handling can be a bit verbose. There are a lot of places where errors are unlikely or where they are so critical that a panic is preferred. Because of this there are lots of Must* -helpers in various packages. E.g. regexp.MustCompile.
3.5 parsecs

Travel
| |
| | bastian.rieck.me

[AI summary] This article provides an introduction to using the GNU Debugger (gdb) for debugging C++ programs, focusing on identifying and fixing a segmentation fault in a palindrome example.
44.9 parsecs

Travel
|