mirror of https://github.com/docker/docs.git
				
				
				
			Read only if there is something to read
Signed-off-by: David Gageot <david@gageot.net>
This commit is contained in:
		
							parent
							
								
									232c0ea37e
								
							
						
					
					
						commit
						501c4f3460
					
				|  | @ -173,12 +173,13 @@ func stream(scanner *bufio.Scanner, streamOutCh chan<- string, stopCh <-chan boo | |||
| 			close(streamOutCh) | ||||
| 			return | ||||
| 		default: | ||||
| 			scanner.Scan() | ||||
| 			line := scanner.Text() | ||||
| 			if err := scanner.Err(); err != nil { | ||||
| 				log.Warnf("Scanning stream: %s", err) | ||||
| 			if scanner.Scan() { | ||||
| 				line := scanner.Text() | ||||
| 				if err := scanner.Err(); err != nil { | ||||
| 					log.Warnf("Scanning stream: %s", err) | ||||
| 				} | ||||
| 				streamOutCh <- strings.Trim(line, "\n") | ||||
| 			} | ||||
| 			streamOutCh <- strings.Trim(line, "\n") | ||||
| 		} | ||||
| 	} | ||||
| } | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue