file

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClearDir

func ClearDir(dirPath string, excludes []string) error

func CopyFile

func CopyFile(sourceFile string, destinationFile string) error

func CopyOrMerge

func CopyOrMerge(sourceFile string, destinationFile string) error

func CreateDirectory

func CreateDirectory(path string) error

func CreateFile

func CreateFile(path, content string) error

func DeleteAll

func DeleteAll(dirPath string) error

func DeleteSingleFile

func DeleteSingleFile(filePath string) error

func Equal

func Equal(fileA string, fileB string) (bool, error)

func Exists

func Exists(filename string) bool

func FindAll

func FindAll(suffix string, excludes []string, dir string) (result []string, err error)

func FindFirst

func FindFirst(fileSuffix string, dir string) (result string, err error)

func Grep

func Grep(filepath string, keyword string) (hit bool, err error)

func GrepRecursive

func GrepRecursive(targetDir string, keyword string) (files []string, err error)

func MergeKeyValFile

func MergeKeyValFile(fromFile string, toFile string, separator string) error

func MergeTextFiles

func MergeTextFiles(fromFile string, toFile string) error

func Move

func Move(source, destination string) error

func Open

func Open(filePath string) ([]byte, error)

func OpenFile

func OpenFile(fileName string) (*os.File, error)

func OpenIgnoreFile

func OpenIgnoreFile(sourceDir string) (lines []string, err error)

func OpenLines

func OpenLines(filePath string) ([]string, error)

func OpenLinesStrict

func OpenLinesStrict(filePath string) ([]string, error)

func Overwrite

func Overwrite(lines []string, filePath string) error

func Path

func Path(format string, a ...interface{}) string

Path safe path function for windows compatibility

func ReadJson

func ReadJson(file string, parsed interface{}) error

func ReadXml

func ReadXml(file string, parsed interface{}) error

func RelPath

func RelPath(sourceDirectory string, filePath string) (string, error)

func RemoveIntellijFiles added in v1.0.1

func RemoveIntellijFiles(targetDir string, recursive bool, dryRun bool) (string, error)

func Render

func Render(inputFilePath string, outputFilePath string, r interface{}) error

func SearchReplace

func SearchReplace(filePath string, from string, to string) error

func SetLogger

func SetLogger(logger logrus.FieldLogger)

func SuffixIn

func SuffixIn(keyword string, list []string) bool

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL