stack/context.go
func splitPath(p string) []string {
	if p == "" {
		return nil
	}
	var out []string
	s := ""
	for _, c := range p {
		if c != '/' || (len(out) == 0 && strings.Count(s, "/") == len(s)) {
			s += string(c)
		} else if s != "" {
			out = append(out, s)
			s = ""
		}
	}
	if s != "" {
		out = append(out, s)
	}
	return out
}
func splitPath(p string) []string {
	if p == "" {
		return nil
	}
	var out []string
	s := ""
	for _, c := range p {
		if c != '/' || (len(out) == 0 && strings.Count(s, "/") == len(s)) {
			s += string(c)
		} else if s != "" {
			out = append(out, s)
			s = ""
		}
	}
	if s != "" {
		out = append(out, s)
	}
	return out
}
func splitPath ( p string ) [ ] string { if p == " " { return nil } var out [ ] string s := " " for _ , c := range p { if c != '/' || ( len ( out ) == 0 && strings . Count ( s , " " ) == len ( s ) ) { s += string ( c ) } else if s != " " { out = append ( out , s ) s = " " } } if s != " " { out = append ( out , s ) } return out }
// splitPath splits a path into its components.
//
// The first item has its initial path separator kept.
splitPath splits a path into its components . The first item has its initial path separator kept .