aboutsummaryrefslogtreecommitdiff
path: root/src/errors/example_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/errors/example_test.go')
-rw-r--r--src/errors/example_test.go16
1 files changed, 0 insertions, 16 deletions
diff --git a/src/errors/example_test.go b/src/errors/example_test.go
index d7dd782bef..5dc8841237 100644
--- a/src/errors/example_test.go
+++ b/src/errors/example_test.go
@@ -5,9 +5,7 @@
package errors_test
import (
- "errors"
"fmt"
- "os"
"time"
)
@@ -34,17 +32,3 @@ func Example() {
}
// Output: 1989-03-15 22:30:00 +0000 UTC: the file system has gone away
}
-
-func ExampleAs() {
- if _, err := os.Open("non-existing"); err != nil {
- var pathError *os.PathError
- if errors.As(err, &pathError) {
- fmt.Println("Failed at path:", pathError.Path)
- } else {
- fmt.Println(err)
- }
- }
-
- // Output:
- // Failed at path: non-existing
-}