Documentation
¶
Index ¶
- func Chmod(name string, mode os.FileMode) error
- func Create(name string) (*os.File, error)
- func MkdirAll(path string, perm os.FileMode) error
- func ReadFile(name string) ([]byte, error)
- func Remove(name string) error
- func WriteFile(name string, data []byte, perm os.FileMode) error
- func WriteFileAtomic(name string, data []byte, perm os.FileMode) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Chmod ¶
Chmod changes file permissions. #nosec G302 -- update downloads must be made executable.
func Create ¶
Create opens a file for writing with a private mode. #nosec G304 -- callers intentionally create files under user-selected directories.
func MkdirAll ¶
MkdirAll creates a directory tree with an explicit mode. #nosec G301 -- callers intentionally manage user-selected paths.
func ReadFile ¶
ReadFile reads a file from a user-selected path. #nosec G304 -- callers intentionally operate on user-selected paths.
func Remove ¶
Remove deletes a file if it exists. #nosec G104 -- cleanup errors are intentionally ignored by callers.
func WriteFile ¶
WriteFile writes a file with an explicit mode. #nosec G306 -- callers intentionally write to user-selected paths.
func WriteFileAtomic ¶
WriteFileAtomic writes data to name atomically by writing to a temporary file in the same directory and then renaming it into place. This prevents readers from observing a partially-written file if the process is interrupted. #nosec G304 -- callers intentionally operate on user-selected paths.
Types ¶
This section is empty.