atomicwrite

package
v1.11.2 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2026 License: Apache-2.0 Imports: 5 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 WriteFileFunc added in v1.8.0

func WriteFileFunc(path string, perm os.FileMode, write func(io.Writer) error) error

func WriteFileFuncWithOptions added in v1.8.0

func WriteFileFuncWithOptions(path string, perm os.FileMode, write func(io.Writer) error, opts Options) 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