55package uri
66
77import (
8+ "errors"
89 "fmt"
910 "net/url"
1011 "path/filepath"
1112 "runtime"
1213 "strings"
1314 "unicode"
14-
15- "golang.org/x/xerrors"
1615)
1716
1817const (
@@ -59,11 +58,11 @@ func (u URI) Filename() string {
5958func filename (uri URI ) (string , error ) {
6059 u , err := url .ParseRequestURI (string (uri ))
6160 if err != nil {
62- return "" , xerrors .Errorf ("failed to parse request URI: %w" , err )
61+ return "" , fmt .Errorf ("failed to parse request URI: %w" , err )
6362 }
6463
6564 if u .Scheme != FileScheme {
66- return "" , xerrors .Errorf ("only file URIs are supported, got %v" , u .Scheme )
65+ return "" , fmt .Errorf ("only file URIs are supported, got %v" , u .Scheme )
6766 }
6867
6968 if isWindowsDriveURI (u .Path ) {
@@ -116,7 +115,7 @@ func File(path string) URI {
116115func Parse (s string ) (u URI , err error ) {
117116 us , err := url .Parse (s )
118117 if err != nil {
119- return u , xerrors .Errorf ("url.Parse: %w\n " , err )
118+ return u , fmt .Errorf ("url.Parse: %w" , err )
120119 }
121120
122121 switch us .Scheme {
@@ -139,7 +138,7 @@ func Parse(s string) (u URI, err error) {
139138 u = URI (ut .String ())
140139
141140 default :
142- return u , xerrors .New ("unknown scheme" )
141+ return u , errors .New ("unknown scheme" )
143142 }
144143
145144 return
0 commit comments