code: func slashdir(p string) string {
  	d := path.Dir(p)
  	if d == "." || d == "/" {
  		return "/"
  	}
  	if strings.HasPrefix(p, "/") {
  		return d
  	}
  	return "/" + d
  }
docs: // slashdir returns path.Dir(p), but special-cases paths not beginning
  // with a slash to be in the root.