aboutsummaryrefslogtreecommitdiffstats
path: root/commands/commands.go
diff options
context:
space:
mode:
Diffstat (limited to 'commands/commands.go')
-rw-r--r--commands/commands.go7
1 files changed, 3 insertions, 4 deletions
diff --git a/commands/commands.go b/commands/commands.go
index 49a8b46e..2890cdd4 100644
--- a/commands/commands.go
+++ b/commands/commands.go
@@ -14,11 +14,10 @@ var (
commands map[string]AercCommand
)
-func init() {
- commands = make(map[string]AercCommand)
-}
-
func Register(name string, cmd AercCommand) {
+ if commands == nil {
+ commands = make(map[string]AercCommand)
+ }
commands[name] = cmd
}