Skip to content

Instantly share code, notes, and snippets.

View dperny's full-sized avatar

Drew Erny dperny

View GitHub Profile
@dperny
dperny / conditional-defer-wrapper.go
Last active May 3, 2017 19:02
Defer if passing example
func DeferIfPassing(t *testing.T, f func()) {
if t.Failed() {
return
}
f()
}
TestDeferIfPassing(t *testing.T) {
// skip a bit, fill in the blanks
defer DeferIfPassing(t, func() { someCleanUp(with, some, args) })
// ORIGINAL container routes
package container
import (
// none of this is important, it literally ONLY imports things like
// "github.com/docker/docker/api/types/whatever"
// there are 0 dependencies on the daemon. GOOD DESIGN.
"github.com/docker/docker/api/types/backend"

Keybase proof

I hereby claim:

  • I am dperny on github.
  • I am dperny (https://keybase.io/dperny) on keybase.
  • I have a public key ASB7lDxqcOua5X9ZNN110QafBICjNopLCSLs2qtaac23IQo

To claim this, I am signing this object: