package
1.7.1
Repository: https://github.com/sinlov-go/go-common-lib.git
Documentation: pkg.go.dev

# Functions

AlterFile alter file @param path string @param data []byte this method will keep file mode if file not exist, will not create file and return error.
AlterFileWithString check or file with content, if file exist, will coverage @param path string @param content string @param fileMod os.FileMode(0o666) os.FileMode(0o644).
AlterFileWithStringFast check or file with content, if file exist, will coverage crate folder of file with os.FileMode(0o666) @param path string @param content string.
AppendFileHead append file head @param path string @param content []byte this method will keep file mode if file not exist, will not create file and return error.
AppendFileTail append file tail @param path string @param content []byte this method will keep file mode if file not exist, will not create file and return error.
CheckOrCreateFileWithString check or create file with content, if file exist, will not coverage @param path string @param content string @param fileMod os.FileMode(0o666) os.FileMode(0o644).
CheckOrCreateFileWithStringFast check or create file with content, if file exist, will not coverage crate folder of file with os.FileMode(0o666) @param path string @param content string.
FetchDefaultFolderFileMode if in windows, will return os.FileMode(0o766), windows not support umask use umask to get folder file mode if not windows, will use umask, will return os.FileMode(0o777) - umask not support umask will use os.FileMode(0o777).
Mkdir will use FetchDefaultFolderFileMode().
PathExists path exists.
PathExistsFast path exists fast.
PathIsDir path is dir.
ReadFileAsByte read file as byte array.
ReadFileAsJson read file as json.
ReadFileAsLines read file as lines, this method will read all line, so if file is too big, will be slow.
ReplaceFileLineByLine read file as lines, this method will read all line, so if file is too big, will be slow.
RmDir remove dir by path nolint:golint,unused.
WriteFileAsJson write json file path most use Abs Path v data fileMod os.FileMode(0o666) or os.FileMode(0o644) coverage true will coverage old beauty will format json when write.
WriteFileAsJsonBeauty write json file as 0666 and beauty.
WriteFileByByte write bytes to file path most use Abs Path data []byte fileMod os.FileMode(0o666) os.FileMode(0o644) coverage true will coverage old.