https://github.com/keegancsmith/tmpfriend
Go library to help tie temporary files to the lifetime of a process.
https://github.com/keegancsmith/tmpfriend
Last synced: 2 months ago
JSON representation
Go library to help tie temporary files to the lifetime of a process.
- Host: GitHub
- URL: https://github.com/keegancsmith/tmpfriend
- Owner: keegancsmith
- License: mit
- Created: 2015-11-17T13:18:17.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2018-04-23T18:02:59.000Z (about 7 years ago)
- Last Synced: 2025-04-12T18:02:45.217Z (2 months ago)
- Language: Go
- Size: 3.91 KB
- Stars: 10
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# tmpfriend [](https://travis-ci.org/keegancsmith/tmpfriend) [](http://godoc.org/github.com/keegancsmith/tmpfriend)
`tmpfriend` is a Go library to help prevent misbehaving subprocesses / code
from forgetting to cleanup after themselves. It works by modifying the
location of the temporary directory to one unique for the current process, and
on start will clean up older temporary directories for non-existant processes.```
func main() {
cleanup := tmpfriend.SetupOrNOOP()
defer cleanup()
// ...
}
```