3 ms·
Nice middleware package. I have to admit, the `log.InfoContext(ctx,...` style of redundancy that permeates the standard lib at this point is really gross, espe
by numbsafari 3y ago
Nice middleware package.
I have to admit, the `log.InfoContext(ctx,...` style of redundancy that permeates the standard lib at this point is really gross, especially given that the most common use case for go is going to have contexts everywhere.
- yashap 3y agoGo’s decision to not support function overloading leads to a tonne of really ugly APIs. Obviously every decision in language design is a tradeoff, but IMO they made the wrong call here.
- philosopher1234 3y agoI'm not sure how I feel about this. What are the actual consequences of these apis being "ugly"? Like, why does that matter?
- numbsafari 3y agoTo me, at least, it is like listening to a person who constantly says "uh..." while talking. Occasionally, sure fine. But it's so pervasive in commonly used APIs that it becomes annoying. Let's be clear: this is just a peeve of mine.
- yencabulator 3y agoThe -Context suffix is only needed when something existed before Context was created. New stuff should be just `foo.Bar(ctx, ...)`
- numbsafari 3y agoIsn't slog, like, completely new as of this release?
- yencabulator 3y agoYes. Then it having separate -Context variants means they really wanted to provide both, and not just the context one.