From 7cc90f2bc552f5b3b49e65e19ac877089e3db137 Mon Sep 17 00:00:00 2001 From: David Calavera Date: Fri, 26 Jul 2013 18:12:05 -0700 Subject: [PATCH] Use a more idiomatic syntax to capture the exit. --- commands.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/commands.go b/commands.go index 1fb56e98a6..d2764086ef 100644 --- a/commands.go +++ b/commands.go @@ -319,12 +319,11 @@ func (cli *DockerCli) CmdLogin(args ...string) error { authconfig = auth.AuthConfig{} } - c := make(chan os.Signal, 1) - signal.Notify(c, syscall.SIGINT, syscall.SIGTERM) + sigchan := make(chan os.Signal, 1) + signal.Notify(sigchan, syscall.SIGINT, syscall.SIGTERM) go func() { - for sig := range c { - os.Exit(1) - } + <-sigchan + os.Exit(1) }() if *flUsername == "" {