errors, fmt: add support for wrapping multiple errors · golang/go@4a0a2b3 · GitHub An error which implements an "Unwrap() []error" method wraps all the non-nil errors in the returned ... https://github.com/golang/go/commit/4a0a2b33dfa3c99250efa222439f2c27d6780e4a Go でエラーを扱う際に、複数のエラーを束ねたい事があります。例えば複数のタスクを実行し、1つでもエラーになれば中断するのではなく、一通りタスクを実施し終えた結果を返したい様なニーズです。 package main import ( "errors" "log" "os"
![Big Sky :: errors.Join が入った。](https://cdn-ak-scissors.b.st-hatena.com/image/square/ae5f360d3c82cd87e23b34fb6f5013ab7cf0f1a6/height=288;version=1;width=512/https%3A%2F%2Fmattn.kaoriya.net%2Fimages%2Flogo.png)