Skip to content
go package defines WorkDir type for easy file operations
Go Shell
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
vendor/github.com
.gitignore
.travis.yml
CHANGELOG.md
README.md
doc.go
example_test.go
go.mod
go.sum
onchange.sh
qa_test.go
setup_test.go
wd.go
wd_test.go

README.md

Build Status codecov

workdir - Go package defines WorkDir type for easy file operations

This package is most useful if you need to do multiple file operations within one directory. Eg. something like

cd /tmp/dir
mkdir child1 child2
touch child1/A child2/B
# do some stuff
cd
rm -rf /tmp/dir

Simply cast a path to a WorkDir type

wd := workdir.New("/tmp/dir")
wd.MkdirAll("child1", "child2")
wd.TouchAll("child1/A", "child2/B")
// do stuff
wd.RemoveAll()

There is also some code here for merging git output with plain ls result.

You can’t perform that action at this time.