Remove unused hooks mechanism

This commit is contained in:
Michael Eischer 2022-07-16 21:35:03 +02:00
parent 04a8ee80fb
commit 82c268c917
2 changed files with 0 additions and 39 deletions

View File

@ -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)
}

View File

@ -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) {}