Lines Matching defs:path
21 "path"
22 "path/filepath"
33 // Filename returns the file path for the given URI.
61 // It will attempt to detect if the string is a file path or uri.
87 if !strings.EqualFold(path.Base(string(a)), path.Base(string(b))) {
110 // FileURI returns a span URI for the supplied file path.
112 func FileURI(path string) URI {
113 if path == "" {
119 if len(path) >= len(prefix) && strings.EqualFold(prefix, path[:len(prefix)]) {
120 suffix := path[len(prefix):]
121 path = runtime.GOROOT() + suffix
123 if !isWindowsDrivePath(path) {
124 if abs, err := filepath.Abs(path); err == nil {
125 path = abs
128 // Check the file path again, in case it became absolute.
129 if isWindowsDrivePath(path) {
130 path = "/" + path
132 path = filepath.ToSlash(path)
135 Path: path,
144 // isWindowsDrivePath returns true if the file path is of the form used by
145 // Windows. We check if the path begins with a drive letter, followed by a ":".
146 func isWindowsDrivePath(path string) bool {
147 if len(path) < 4 {
150 return unicode.IsLetter(rune(path[0])) && path[1] == ':'
155 // (see https://golang.org/issue/6027). We check if the URI path has