aboutsummaryrefslogtreecommitdiff
path: root/src/debug
diff options
context:
space:
mode:
Diffstat (limited to 'src/debug')
-rw-r--r--src/debug/buildinfo/buildinfo.go2
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)