Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Pretty good article. One comment: it recommends zerolog for logging, but recently slog [1] has started to become part of the standard lib. I guess it’s the future.

[1]: https://pkg.go.dev/golang.org/x/exp/slog



I used slog for a project a few months ago; then I stopped working on it and continued on it a few weeks ago and there were all sorts of incompatible changes.

That's completely fair; it's still in development so this isn't a complaint! But just saying, at this point you need to be prepared to have to deal with that.


FWIW: slog has been pretty stable for a month or two, and should be officially standard library in go1.21

There was a last round of changes mostly revisiting use of contexts a few months ago - hats off to jba for taking a lot of time to work out the best fit


Where do you keep up to date on what will be included in future releases?


A few places I look: - https://dev.golang.org/release#Go1.21 - might be the same info as https://github.com/golang/go/milestone/279 in a different form

and here is a link to the draft release notes https://tip.golang.org/doc/go1.21


Interesting. Though bleh, I would LOVE it if Go would stop releasing things like this with global default values - it leads to tons of libraries not building a way to pass in specific loggers. Better to cut that off at the head.


I use zerolog at work - I can vouch that it does the job just fine.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: