about summary refs log tree commit diff
path: root/tools/gerrit-hook/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'tools/gerrit-hook/main.go')
-rw-r--r--tools/gerrit-hook/main.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/tools/gerrit-hook/main.go b/tools/gerrit-hook/main.go
index aae73ba..5461490 100644
--- a/tools/gerrit-hook/main.go
+++ b/tools/gerrit-hook/main.go
@@ -50,16 +50,17 @@ func main() {
 		os.Exit(1)
 	}
 
-	if cmd == "patchset-created" {
+	switch cmd {
+	case "patchset-created":
 		trigger, err := triggerForPatchsetCreated()
 		if err != nil {
 			log.Crit(fmt.Sprintf("failed to create a trigger: %s", err))
 			os.Exit(1)
 		}
 		gerritHookMain(cfg, log, trigger)
-	} else if cmd == "post-command" {
+	case "post-command":
 		postCommand(cfg)
-	} else {
+	default:
 		log.Info(fmt.Sprintf("`%s' is not a supported command", cmd))
 		os.Exit(1)
 	}