MCPcopy Create free account
hub / github.com/cli/cli / trimTrailingPathSeparators

Function trimTrailingPathSeparators

pkg/cmd/repo/read-file/read_file.go:311–320  ·  view source on GitHub ↗
(path string)

Source from the content-addressed store, hash-verified

309}
310
311func 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
322func rootedWriteOutputFile(dir, name string, data []byte, perm os.FileMode, replace bool) error {
323 if dir == "" {

Callers 1

writeToOutputFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected