Documentation ¶ Overview ¶ Package fileutil contains the CLI's owner-only file replacement primitive. Index ¶ func Lock(ctx context.Context, path string) (func(), error) func WriteFile(path string, data []byte) error Constants ¶ This section is empty. Variables ¶ This section is empty. Functions ¶ func Lock ¶ func Lock(ctx context.Context, path string) (func(), error) Lock takes an exclusive lock between processes by creating path, waiting while another process holds it. The returned function releases it. func WriteFile ¶ func WriteFile(path string, data []byte) error WriteFile replaces path with data without exposing a partially written file. It creates new directories with mode 0700 and the replacement with mode 0600. Callers remain responsible for coordinating read-modify-write transactions. Types ¶ This section is empty. Source Files ¶ View all Source files atomic.golock.go Click to show internal directories. Click to hide internal directories.