1 // Copyright 2019 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
11 "golang.org/x/xerrors"
15 _, err := os.Open("non-existing")
17 var pathError *os.PathError
18 if xerrors.As(err, &pathError) {
19 fmt.Println("Failed at path:", pathError.Path)
24 // Failed at path: non-existing