On Mon, Aug 7, 2023 at 4:32 AM jal...@gmail.com <jalo...@gmail.com> wrote:
>
> In the errors.join proposal, the proposed api had the user specify how they 
> wanted the errors to be formatted together. But the actual implementation 
> omitted and only used new line.
>
> This is quite unfortunate if you are using slog and want to log that error 
> and very much need a log statement to not span multiple lines. It also makes 
> it much harder to read.
>
> Does anyone recall why sep was dropped?

See the discussion at https://go.dev/issue/53435, especially
https://github.com/golang/go/issues/53435#issuecomment-1190654775 and
https://github.com/golang/go/issues/53435#issuecomment-1190845424.

As far as the slog package it seems to me that a handler can enforce
that individual messages are on a single line.  There may be a better
way to address that problem, but I don't think that errors.Join is the
right place for a fix.  Any random package can generate multiline
error messages with errors.New("a\nb"), and I've seen plenty that do.
So enforcing single-line messages on errors.Join won't fix the problem
in general.

Ian

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAOyqgcV%3D1QeVeiJnaVZadNN8Mg2YVsb3oLeUTay%2Bm6dJ9PHhQQ%40mail.gmail.com.

Reply via email to