simplify: delegate osroot.MkdirAll to native os.Root.MkdirAll

main

Commit

Soph3mo ago

Go 1.26's os.Root has a native MkdirAll, so the hand-rolled per-segment Mkdir loop (with its ToSlash/Trim/path.Join handling and extra imports) collapses to a one-line delegation — battle-tested and stats before creating. Also:

  • drop the dead dir != "" guard in the rewind restore loop (path.Dir never returns "")
  • drop TestMkdirAll_EmptyOrDotIsNoop, which exercised the removed Trim/no-op logic; the call site never passes ""/"."
  • correct the now-stale osroot package doc that listed MkdirAll as unsupported

Pure cleanup from a /simplify review; no behavior change.

Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com Entire-Checkpoint: 38a921fb7470

Checkpoints

Review Security Vulnerability Report

Claude CodeOpus 4.8[1m]
View session
Checkpoint 1