(path string)
| 309 | } |
| 310 | |
| 311 | func trimTrailingPathSeparators(path string) string { |
| 312 | end := len(path) |
| 313 | for end > 0 && os.IsPathSeparator(path[end-1]) { |
| 314 | end-- |
| 315 | } |
| 316 | if end == 0 || end <= len(filepath.VolumeName(path)) { |
| 317 | return path |
| 318 | } |
| 319 | return path[:end] |
| 320 | } |
| 321 | |
| 322 | func rootedWriteOutputFile(dir, name string, data []byte, perm os.FileMode, replace bool) error { |
| 323 | if dir == "" { |