2 pages tagged with "go"
Go Archer
January 04, 2025
For a long time I have been using
github.com/loov/goda whenever I wanted to build
a graph of dependencies for a Go project. It is an excelent tool, but I wanted
some additional functionality. Usually I use the graph to identify problematic
dependencies; for example, if there is a dependency on a dat…
read more
Error handling in defer
October 07, 2023
I see periodically people handling errors in deferred calls like this:
func Do() (r Result, err error) {
// ...
defer func() {
err = multierr.Append(err, f.Close())
}()
// ...
}
or another variant:
func Do() (err error) {
// ...
defer func() {
err1 = f.Close(…
read more