atomicwrite

package
v1.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 14, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetBeforeRenameHookForTest

func SetBeforeRenameHookForTest(hook func(path string, tempPath string) error) (restore func())

SetBeforeRenameHookForTest installs a process-wide hook used by tests to simulate interruptions between file sync and rename commit.

func WriteFile

func WriteFile(path string, payload []byte, perm os.FileMode) error

func WriteFileWithOptions

func WriteFileWithOptions(path string, payload []byte, perm os.FileMode, opts Options) error

Types

type Options

type Options struct {
	BeforeRename func(path string, tempPath string) error
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL