Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateWith ¶ added in v0.3.0
func CreateWith(path string, handler FileHandler) (err error)
Create a file and use it inside a closure. Will automatically close the file after the closure completes and remove the corrupt file if an error is thrown.
func CreateWithTemp ¶ added in v0.3.0
func CreateWithTemp(path string, handler FileHandler) error
Like CreateWith, but will create a temporary file and rename it to the final path once the file has been written successfully. If an error occurs, the temp file will be removed.
Types ¶
type FileHandler ¶ added in v0.3.0
Click to show internal directories.
Click to hide internal directories.