mirror of https://github.com/restic/restic.git
Remove unused hooks mechanism
This commit is contained in:
parent
04a8ee80fb
commit
82c268c917
|
@ -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 New Issue