mirror of
https://github.com/clearlinux/docker.git
synced 2026-08-21 13:18:00 +00:00
Use a more idiomatic syntax to capture the exit.
This commit is contained in:
+4
-5
@@ -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 == "" {
|
||||
|
||||
Reference in New Issue
Block a user