File tree Expand file tree Collapse file tree 2 files changed +6
-12
lines changed
Expand file tree Collapse file tree 2 files changed +6
-12
lines changed Original file line number Diff line number Diff line change @@ -53,16 +53,14 @@ information is displayed once every 5 seconds.`,
5353 events = make (chan * types.Event , 1024 )
5454 group = & sync.WaitGroup {}
5555 )
56- group .Add (1 )
57- go func () {
58- defer group .Done ()
56+ group .Go (func () {
5957 enc := json .NewEncoder (os .Stdout )
6058 for e := range events {
6159 if err := enc .Encode (e ); err != nil {
6260 logrus .Error (err )
6361 }
6462 }
65- }( )
63+ })
6664 if context .Bool ("stats" ) {
6765 s , err := container .Stats ()
6866 if err != nil {
Original file line number Diff line number Diff line change @@ -117,17 +117,13 @@ func handleSingle(path string, noStdin bool) error {
117117 wg sync.WaitGroup
118118 inErr , outErr error
119119 )
120- wg .Add (1 )
121- go func () {
120+ wg .Go (func () {
122121 _ , outErr = io .Copy (os .Stdout , c )
123- wg .Done ()
124- }()
122+ })
125123 if ! noStdin {
126- wg .Add (1 )
127- go func () {
124+ wg .Go (func () {
128125 _ , inErr = io .Copy (c , os .Stdin )
129- wg .Done ()
130- }()
126+ })
131127 }
132128
133129 // Only close the master fd once we've stopped copying.
You can’t perform that action at this time.
0 commit comments