diff options
| author | Julien Cretel <jub0bsinthecloud@gmail.com> | 2025-10-01 20:08:18 +0000 |
|---|---|---|
| committer | Gopher Robot <gobot@golang.org> | 2025-10-13 10:12:48 -0700 |
| commit | 6bcd97d9f4386528aa85eb3cc27da0ed902de870 (patch) | |
| tree | 54acec806440b95e7afc493d42b0b095fdaee1a5 /src/debug | |
| parent | 1cd71689f2ed8f07031a0cc58fc3586ca501839f (diff) | |
| download | go-6bcd97d9f4386528aa85eb3cc27da0ed902de870.tar.xz | |
all: replace calls to errors.As with errors.AsType
This change replaces most occurrences (in code as well as in comments) of
errors.As with errors.AsType. It leaves the errors package and vendored
code untouched.
Change-Id: I3bde73f318a0b408bdb8f5a251494af15a13118a
GitHub-Last-Rev: 8aaaa36a5a12d2a6a90c6d51680464e1a3115139
GitHub-Pull-Request: golang/go#75698
Reviewed-on: https://go-review.googlesource.com/c/go/+/708495
Auto-Submit: Michael Pratt <mpratt@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
Diffstat (limited to 'src/debug')
| -rw-r--r-- | src/debug/buildinfo/buildinfo.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/debug/buildinfo/buildinfo.go b/src/debug/buildinfo/buildinfo.go index 12e3b750d2..d202d5050a 100644 --- a/src/debug/buildinfo/buildinfo.go +++ b/src/debug/buildinfo/buildinfo.go @@ -67,7 +67,7 @@ const ( // with module support. func ReadFile(name string) (info *BuildInfo, err error) { defer func() { - if pathErr := (*fs.PathError)(nil); errors.As(err, &pathErr) { + if _, ok := errors.AsType[*fs.PathError](err); ok { err = fmt.Errorf("could not read Go build info: %w", err) } else if err != nil { err = fmt.Errorf("could not read Go build info from %s: %w", name, err) |
