Use a more idiomatic syntax to capture the exit.

This commit is contained in:
David Calavera 2013-07-26 18:12:05 -07:00
parent 01ce312c2d
commit 7cc90f2bc5
1 changed files with 4 additions and 5 deletions

View File

@ -319,12 +319,11 @@ func (cli *DockerCli) CmdLogin(args ...string) error {
authconfig = auth.AuthConfig{} authconfig = auth.AuthConfig{}
} }
c := make(chan os.Signal, 1) sigchan := make(chan os.Signal, 1)
signal.Notify(c, syscall.SIGINT, syscall.SIGTERM) signal.Notify(sigchan, syscall.SIGINT, syscall.SIGTERM)
go func() { go func() {
for sig := range c { <-sigchan
os.Exit(1) os.Exit(1)
}
}() }()
if *flUsername == "" { if *flUsername == "" {