4 ms·
One of the most common errors that i used to encounter when i first started with golang was- accessing a map without initializing it first. For example: v
by LaFolle 9y ago
One of the most common errors that i used to encounter when i first started with golang was- accessing a map without initializing it first. For example:
var m map[string]int
m["name"] = 23
which resulted in "panic: assignment to entry in nil map".
Nil pointer access errors are relatively easy to debug when in Go world, as compared to in CGO. Like, we are using zmq via CGO in one of our project and when these errors occured, we had to use gdb to debug (apart from logging). At one time we even used rr.
rr is really cool, everyone should check this out.
https://github.com/mozilla/rr https://github.com/mozilla/rr