diff --git a/pkg/tools/tools.go b/pkg/tools/tools.go index 172f24f..a4f4ab2 100644 --- a/pkg/tools/tools.go +++ b/pkg/tools/tools.go @@ -1,2 +1,11 @@ // Package tools contains helpers package tools + +import "io" + +// LazyClose closes an [io.Closer] and discards the error +func LazyClose(p io.Closer) { + if p != nil { + _ = p.Close() + } +}