]> Cypherpunks repositories - gostls13.git/commit
testing/fstest: return structured errors in TestFS
authorOlivier Mengué <olivier.mengue@gmail.com>
Sun, 22 Oct 2023 23:19:01 +0000 (01:19 +0200)
committerGopher Robot <gobot@golang.org>
Fri, 5 Apr 2024 17:45:39 +0000 (17:45 +0000)
commit74cce866f865c3188a34309e4ebc7a5c9ed0683d
treec7f49193c275ad5b28d08e1b53228f547fadc377
parentb24ec88bb93438bfabca34a2acb739a629c23806
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>
doc/next/6-stdlib/99-minor/testing/fstest/63675.md [new file with mode: 0644]
src/testing/fstest/testfs.go
src/testing/fstest/testfs_test.go