Simplify if block -- reduce nesting
This commit is contained in:
parent
baad906d24
commit
0389a66cb9
@ -377,10 +377,11 @@ func reloadHooks(hooksFilePath string) {
|
|||||||
log.Printf("attempting to reload hooks from %s\n", hooksFilePath)
|
log.Printf("attempting to reload hooks from %s\n", hooksFilePath)
|
||||||
|
|
||||||
err := hooksInFile.LoadFromFile(hooksFilePath)
|
err := hooksInFile.LoadFromFile(hooksFilePath)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("couldn't load hooks from file! %+v\n", err)
|
log.Printf("couldn't load hooks from file! %+v\n", err)
|
||||||
} else {
|
return
|
||||||
|
}
|
||||||
|
|
||||||
seenHooksIds := make(map[string]bool)
|
seenHooksIds := make(map[string]bool)
|
||||||
|
|
||||||
log.Printf("found %d hook(s) in file\n", len(hooksInFile))
|
log.Printf("found %d hook(s) in file\n", len(hooksInFile))
|
||||||
@ -407,7 +408,6 @@ func reloadHooks(hooksFilePath string) {
|
|||||||
|
|
||||||
loadedHooksFromFiles[hooksFilePath] = hooksInFile
|
loadedHooksFromFiles[hooksFilePath] = hooksInFile
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
func reloadAllHooks() {
|
func reloadAllHooks() {
|
||||||
for _, hooksFilePath := range hooksFiles {
|
for _, hooksFilePath := range hooksFiles {
|
||||||
|
Loading…
Reference in New Issue
Block a user