gocleanups

package module
v0.0.0-...-023a36f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 14, 2019 License: MIT Imports: 0 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

gocleanups

This golang module is a helper to cleanup resources.

Inspired by Wire's Cleanup functions

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cleanups

type Cleanups []func()

Cleanups struct

func NewCleanups

func NewCleanups(funcs ...func()) Cleanups

NewCleanups constructor

func (*Cleanups) Add

func (c *Cleanups) Add(funcs ...func())

Add cleanup funcs to Cleanups

func (Cleanups) Export

func (c Cleanups) Export() func()

Export Cleanups as simple func

func (Cleanups) Len

func (c Cleanups) Len() int

Len returns the number of cleanup functions

func (Cleanups) Run

func (c Cleanups) Run()

Run all Cleanups

func (*Cleanups) RunAndReset

func (c *Cleanups) RunAndReset()

RunAndReset runs all Cleanups and resets funcs to empty slice

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL