Documentation ¶ Index ¶ func Lock(path string) (release func(), err error) func Write(target string, data []byte, mode os.FileMode) error Constants ¶ This section is empty. Variables ¶ This section is empty. Functions ¶ func Lock ¶ func Lock(path string) (release func(), err error) Lock acquires an exclusive advisory flock on path. The lockfile is intentionally never removed — unlinking the inode while another process is in flock races with concurrent acquirers. func Write ¶ func Write(target string, data []byte, mode os.FileMode) error Write atomically replaces target via a sibling tempfile + rename. Parent dir must exist. Types ¶ This section is empty. Source Files ¶ View all Source files atomicfile.golock.go Click to show internal directories. Click to hide internal directories.