diff options
Diffstat (limited to 'src/cmd/godoc/mapping.go')
-rw-r--r-- | src/cmd/godoc/mapping.go | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/cmd/godoc/mapping.go b/src/cmd/godoc/mapping.go index 6ae9032e4..92614e83e 100644 --- a/src/cmd/godoc/mapping.go +++ b/src/cmd/godoc/mapping.go @@ -9,7 +9,6 @@ package main import ( "fmt" "io" - "os" "path" "path/filepath" "sort" @@ -60,10 +59,10 @@ type mapping struct { } -// Init initializes the Mapping from a list of paths separated by -// filepath.ListSeparator. Empty paths are ignored; relative paths -// are assumed to be relative to the current working directory and -// converted to absolute paths. For each path of the form: +// Init initializes the Mapping from a list of paths. +// Empty paths are ignored; relative paths are assumed to be relative to +// the current working directory and converted to absolute paths. +// For each path of the form: // // dirname/localname // @@ -81,8 +80,8 @@ type mapping struct { // user -> /home/user // public -> /home/build/public // -func (m *Mapping) Init(paths string) { - pathlist := canonicalizePaths(filepath.SplitList(paths), nil) +func (m *Mapping) Init(paths []string) { + pathlist := canonicalizePaths(paths, nil) list := make([]mapping, len(pathlist)) // create mapping list @@ -121,7 +120,7 @@ func (m *Mapping) PrefixList() []string { } // sort the list and remove duplicate entries - sort.SortStrings(list) + sort.Strings(list) i := 0 prev := "" for _, path := range list { @@ -174,7 +173,7 @@ func (m *Mapping) ToAbsolute(spath string) string { continue // no match } abspath := filepath.Join(e.path, tail) - if _, err := os.Stat(abspath); err == nil { + if _, err := fs.Stat(abspath); err == nil { return abspath } } |