Merge pull request #13885 from rjharvey/master

Close io.ReadCloser in examples
This commit is contained in:
Usha Mandya 2021-11-26 12:56:57 +00:00 committed by GitHub
commit c979cc7f86
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -62,6 +62,8 @@ func main() {
if err != nil {
panic(err)
}
defer reader.Close()
io.Copy(os.Stdout, reader)
resp, err := cli.ContainerCreate(ctx, &container.Config{
@ -182,6 +184,7 @@ func main() {
if err != nil {
panic(err)
}
defer out.Close()
io.Copy(os.Stdout, out)
resp, err := cli.ContainerCreate(ctx, &container.Config{