forked from TrueCloudLab/restic
Remove unused hooks mechanism
This commit is contained in:
parent
04a8ee80fb
commit
82c268c917
2 changed files with 0 additions and 39 deletions
|
@ -1,29 +0,0 @@
|
|||
//go:build debug
|
||||
// +build debug
|
||||
|
||||
package debug
|
||||
|
||||
var (
|
||||
hooks map[string]func(interface{})
|
||||
)
|
||||
|
||||
func init() {
|
||||
hooks = make(map[string]func(interface{}))
|
||||
}
|
||||
|
||||
func Hook(name string, f func(interface{})) {
|
||||
hooks[name] = f
|
||||
}
|
||||
|
||||
func RunHook(name string, context interface{}) {
|
||||
f, ok := hooks[name]
|
||||
if !ok {
|
||||
return
|
||||
}
|
||||
|
||||
f(context)
|
||||
}
|
||||
|
||||
func RemoveHook(name string) {
|
||||
delete(hooks, name)
|
||||
}
|
|
@ -1,10 +0,0 @@
|
|||
//go:build !debug
|
||||
// +build !debug
|
||||
|
||||
package debug
|
||||
|
||||
func Hook(name string, f func(interface{})) {}
|
||||
|
||||
func RunHook(name string, context interface{}) {}
|
||||
|
||||
func RemoveHook(name string) {}
|
Loading…
Reference in a new issue