A Go library that provides several helpful functions for working with files.
Execute the following on the commandline:
go get github.com/stephen-fox/cabinet
Then, in your Go application, add the following import statement:
import (
"github.com/stephen-fox/cabinet"
)
Exists
- Check if a file or directory existsFileExists
- Check if a file existsDirectoryExists
- Check if a directory existsCopyFilesWithSuffix
- Recursively copy files ending with a suffix. Optionally specify if existing files should be overwrittenCopyDirectory
- Recursively copy a directory. Optionally specify if existing files should be overwrittenCopyFile
- Copy a file. Optionally specify if an existing file should be overwrittenDownloadFile
- Download a fileReplaceLineInFile
- Replace a line in a fileGetFileHash
- Get a file's hash using thehash.Hash
interface