diff options
author | Olivier Mengué <olivier.mengue@gmail.com> | 2023-10-23 01:19:01 +0200 |
---|---|---|
committer | Gopher Robot <gobot@golang.org> | 2024-04-05 17:45:39 +0000 |
commit | 74cce866f865c3188a34309e4ebc7a5c9ed0683d (patch) | |
tree | c7f49193c275ad5b28d08e1b53228f547fadc377 /doc | |
parent | b24ec88bb93438bfabca34a2acb739a629c23806 (diff) | |
download | go-74cce866f865c3188a34309e4ebc7a5c9ed0683d.tar.gz go-74cce866f865c3188a34309e4ebc7a5c9ed0683d.zip |
testing/fstest: return structured errors in TestFS
TestFS now returns a structured error built with errors.Join to allow to
inspect errors using errors.Is and errors.As.
All errors are now wrapped using fmt.Errorf and %w.
Fixes #63675.
Change-Id: I8fc3363f8ae70085af4afdb84c16be9ca70d7731
Reviewed-on: https://go-review.googlesource.com/c/go/+/537015
Reviewed-by: Bryan Mills <bcmills@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Diffstat (limited to 'doc')
-rw-r--r-- | doc/next/6-stdlib/99-minor/testing/fstest/63675.md | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/doc/next/6-stdlib/99-minor/testing/fstest/63675.md b/doc/next/6-stdlib/99-minor/testing/fstest/63675.md new file mode 100644 index 0000000000..1a3552d50d --- /dev/null +++ b/doc/next/6-stdlib/99-minor/testing/fstest/63675.md @@ -0,0 +1,4 @@ +[`TestFS`](/pkg/testing/fstest#TestFS) now returns a structured +error that can be unwrapped (via method `Unwrap() []error`). This allows +inspecting errors using [`errors.Is`](/pkg/errors#Is) or +[`errors.As`](/pkg/errors#As). |