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

Method redirectTargetIsDir

internal/safepaths/root.go:454–463  ·  view source on GitHub ↗
(parent *os.Root, name string)

Source from the content-addressed store, hash-verified

452}
453
454func (r *Root) redirectTargetIsDir(parent *os.Root, name string) (bool, error) {
455 info, err := r.stat(parent, name)
456 if os.IsNotExist(err) {
457 return false, nil
458 }
459 if err != nil {
460 return false, fmt.Errorf("could not safely classify redirect target %q: %w", name, err)
461 }
462 return info.IsDir(), nil
463}
464
465func directoryWriteError(path string) error {
466 return &os.PathError{Op: "open", Path: path, Err: syscall.EISDIR}

Callers 1

CreateMethod · 0.95

Calls 2

IsDirMethod · 0.80
ErrorfMethod · 0.65

Tested by

no test coverage detected