5 ms·
You use attrs [1] instead. I personally find this much more readable, and prefer this. slog.Info("hello, world", slog.String("user", os.Getenv("USER"))) [1]
by AkshitGarg 3y ago
You use attrs [1] instead. I personally find this much more readable, and prefer this.
slog.Info("hello, world", slog.String("user", os.Getenv("USER")))
[1]: https://pkg.go.dev/log/slog#hdr-Attrs_and_Values https://pkg.go.dev/log/slog#hdr-Attrs_and_Values