MCPcopy Create free account
hub / github.com/git-bug/git-bug / clean

Function clean

util/interrupt/cleaner.go:68–83  ·  view source on GitHub ↗

clean invokes all registered cleanup functions, and returns a list of errors, if they exist.

()

Source from the content-addressed store, hash-verified

66
67// clean invokes all registered cleanup functions, and returns a list of errors, if they exist.
68func clean() (errorList []error) {
69 mu.Lock()
70 defer mu.Unlock()
71
72 for _, cleaner := range cleaners {
73 if cleaner.disabled {
74 continue
75 }
76 err := cleaner.f()
77 if err != nil {
78 errorList = append(errorList, err)
79 }
80 }
81 cleaners = []*wrapper{}
82 return
83}

Callers 4

RegisterCleanerFunction · 0.85
TestRegisterAndCleanFunction · 0.85
TestCancelFunction · 0.85

Calls 1

LockMethod · 0.65

Tested by 3

TestRegisterAndCleanFunction · 0.68
TestCancelFunction · 0.68