pkg/environment: Migrate fs functions to fsx

This commit is contained in:
Tom Wiesing 2023-03-02 11:38:30 +01:00
parent 45540ab253
commit 5a43ecfaeb
No known key found for this signature in database
21 changed files with 155 additions and 199 deletions

16
pkg/fsx/fsx.go Normal file
View file

@ -0,0 +1,16 @@
// Package fsx provides additional file system functionality.
//
// Several functions in this package provide umask-ignoring functions.
// Using these functions intervenes with the global umask.
//
// It is not safe to use functions provided by the standard go library concurrently with this function.
// Users should take care that no other code in their application uses these functions.
package fsx
import "io/fs"
// DefaultFilePerm should be used by callers to use a consistent file mode for new files.
const DefaultFilePerm fs.FileMode = 0666
// DefaultDirPerm should be used by callers to use a consistent mode for new directories.
const DefaultDirPerm fs.FileMode = fs.ModeDir | fs.ModePerm