Documentation ¶ Index ¶ func SyncDir(dir string) error func WriteFileAtomic(path string, data []byte, perm os.FileMode) error Constants ¶ This section is empty. Variables ¶ This section is empty. Functions ¶ func SyncDir ¶ added in v0.16.0 func SyncDir(dir string) error SyncDir fsyncs a directory so renames inside it survive a crash. Callers that publish content with rename rather than WriteFileAtomic use it to make the swap durable before recording state that depends on it. func WriteFileAtomic ¶ func WriteFileAtomic(path string, data []byte, perm os.FileMode) error WriteFileAtomic writes data to path using a temp file and atomic rename. perm sets the file mode applied to the final file. Types ¶ This section is empty. Source Files ¶ View all Source files write.go Click to show internal directories. Click to hide internal directories.