News for hackers. Stuff that matters.
Re:Logging in Go with Slog: A Practitioner's Guide by dlock17 on Tuesday September 16, 2025 @01:53PM (#45265499)
I felt the same way, and made my own package for adding slog attributes to an error for easier logging. It's usually all I need for my own custom errors.

https://github.com/Danlock/pkg/blob/main/errors/attr_test.go

I can understand why it's not in the stdlib though, it seems easy enough to run into key overwriting issues if a dependency returned custom errors with attributes.

I appreciate the built in support slog has for slog.GroupValue and the slog.LogValuer interface that enables everyone to build a solution best for their needs.

There are no comments on this comment yet.