top
(README.md)
GoCleanup
=========

It's kinda like atexit()

GoCleanup is a big bag of singleton methods to enable `atexit`-like behavior in Golang.  If you don't like singletons... move along ;)

It's simple.  You register functions to run on exit with

```go
gocleanup.Register(func() {
    //do stuff
})
```

If the running program receives a SIGINT, or SIGTERM cleanup will intercept the signal, run all the registered clean up functions and then exit with status 1.

If you want to exit from within your code, you'll need to call

```go
gocleanup.Exit(statuscode)
```

to ensure the cleanup callbacks are run.

Finally, if you want to manually invoke the cleanup callbacks (without exiting):

```go
gocleanup.Cleanup()
```

this will also unregister any registered cleanup functions.

Imported by 16 package(s)

  1. github.com/DevTable/docker-builder
  2. github.com/DevTable/docker-builder/builder
  3. github.com/DevTable/docker-builder/server/webhook
  4. github.com/colegleason/docker-builder
  5. github.com/colegleason/docker-builder/builder
  6. github.com/colegleason/docker-builder/parser
  7. github.com/jszwedko/docker-builder
  8. github.com/jszwedko/docker-builder/builder
  9. github.com/kanuku/docker-builder
  10. github.com/kanuku/docker-builder/server/webhook
  11. github.com/modcloth/docker-builder/server/webhook
  12. github.com/modcloth/queued-command-runner/qcr
  13. github.com/rafecolton/docker-builder
  14. github.com/rafecolton/docker-builder/server/webhook
  15. github.com/sylphon/builder-core/builder
  16. github.com/winchman/builder-core/builder

Imported only in test by 1 package(s)

  1. github.com/rafecolton/gocleanup

Test imports 2 package(s)

  1. github.com/onsi/ginkgo
  2. github.com/onsi/gomega