Candango fsok is a Go library designed to make file and directory operations simple, reliable, and idiomatic. It provides helpers for common tasks such as checking existence, copying directories, and working with files — all with Go best practices in mind.
Use go get to install:
go get github.com/candango/fsokThen import in your code:
import "github.com/candango/fsok"import "github.com/candango/fsok/dir"
if dir.Exists("/tmp/mydir") {
// Directory exists
}import "github.com/candango/fsok/dir"
err := dir.CopyAll("source", "destination")
if err != nil {
log.Fatal(err)
}import "github.com/candango/fsok/file"
if file.Exists("myfile.txt") {
// File exists
}Contributions are welcome! Please open issues or pull requests on GitHub.