Source file src/path/filepath/path_plan9.go

     1  // Copyright 2010 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.
     4  
     5  package filepath
     6  
     7  import (
     8  	"strings"
     9  )
    10  
    11  // HasPrefix exists for historical compatibility and should not be used.
    12  //
    13  // Deprecated: HasPrefix does not respect path boundaries and
    14  // does not ignore case when required.
    15  func HasPrefix(p, prefix string) bool {
    16  	return strings.HasPrefix(p, prefix)
    17  }
    18  
    19  func splitList(path string) []string {
    20  	if path == "" {
    21  		return []string{}
    22  	}
    23  	return strings.Split(path, string(ListSeparator))
    24  }
    25  
    26  func abs(path string) (string, error) {
    27  	return unixAbs(path)
    28  }
    29  
    30  func join(elem []string) string {
    31  	// If there's a bug here, fix the logic in ./path_unix.go too.
    32  	for i, e := range elem {
    33  		if e != "" {
    34  			return Clean(strings.Join(elem[i:], string(Separator)))
    35  		}
    36  	}
    37  	return ""
    38  }
    39  
    40  func sameWord(a, b string) bool {
    41  	return a == b
    42  }
    43  

View as plain text