@@ -17,7 +17,7 @@ import (
1717
1818// containerStatPath stats the filesystem resource at the specified path in this
1919// container. Returns stat info about the resource.
20- func (daemon * Daemon ) containerStatPath (container * container.Container , path string ) (stat * containertypes.PathStat , err error ) {
20+ func (daemon * Daemon ) containerStatPath (container * container.Container , path string ) (* containertypes.PathStat , error ) {
2121 container .Lock ()
2222 defer container .Unlock ()
2323
@@ -26,12 +26,12 @@ func (daemon *Daemon) containerStatPath(container *container.Container, path str
2626 return nil , err
2727 }
2828
29- if err = daemon .Mount (container ); err != nil {
29+ if err : = daemon .Mount (container ); err != nil {
3030 return nil , err
3131 }
3232 defer daemon .Unmount (container )
3333
34- err = daemon .mountVolumes (container )
34+ err : = daemon .mountVolumes (container )
3535 defer container .DetachAndUnmount (daemon .LogVolumeEvent )
3636 if err != nil {
3737 return nil , err
@@ -51,11 +51,11 @@ func (daemon *Daemon) containerStatPath(container *container.Container, path str
5151// containerArchivePath creates an archive of the filesystem resource at the specified
5252// path in this container. Returns a tar archive of the resource and stat info
5353// about the resource.
54- func (daemon * Daemon ) containerArchivePath (container * container.Container , path string ) (content io.ReadCloser , stat * containertypes.PathStat , err error ) {
54+ func (daemon * Daemon ) containerArchivePath (container * container.Container , path string ) (content io.ReadCloser , stat * containertypes.PathStat , retErr error ) {
5555 container .Lock ()
5656
5757 defer func () {
58- if err != nil {
58+ if retErr != nil {
5959 // Wait to unlock the container until the archive is fully read
6060 // (see the ReadCloseWrapper func below) or if there is an error
6161 // before that occurs.
@@ -68,20 +68,20 @@ func (daemon *Daemon) containerArchivePath(container *container.Container, path
6868 return nil , nil , err
6969 }
7070
71- if err = daemon .Mount (container ); err != nil {
71+ if err : = daemon .Mount (container ); err != nil {
7272 return nil , nil , err
7373 }
7474
7575 defer func () {
76- if err != nil {
76+ if retErr != nil {
7777 // unmount any volumes
7878 container .DetachAndUnmount (daemon .LogVolumeEvent )
7979 // unmount the container's rootfs
8080 daemon .Unmount (container )
8181 }
8282 }()
8383
84- if err = daemon .mountVolumes (container ); err != nil {
84+ if err : = daemon .mountVolumes (container ); err != nil {
8585 return nil , nil , err
8686 }
8787
@@ -223,14 +223,14 @@ func (daemon *Daemon) containerExtractToDir(container *container.Container, path
223223 return nil
224224}
225225
226- func (daemon * Daemon ) containerCopy (container * container.Container , resource string ) (rc io.ReadCloser , err error ) {
226+ func (daemon * Daemon ) containerCopy (container * container.Container , resource string ) (_ io.ReadCloser , retErr error ) {
227227 if resource [0 ] == '/' || resource [0 ] == '\\' {
228228 resource = resource [1 :]
229229 }
230230 container .Lock ()
231231
232232 defer func () {
233- if err != nil {
233+ if retErr != nil {
234234 // Wait to unlock the container until the archive is fully read
235235 // (see the ReadCloseWrapper func below) or if there is an error
236236 // before that occurs.
@@ -248,7 +248,7 @@ func (daemon *Daemon) containerCopy(container *container.Container, resource str
248248 }
249249
250250 defer func () {
251- if err != nil {
251+ if retErr != nil {
252252 // unmount any volumes
253253 container .DetachAndUnmount (daemon .LogVolumeEvent )
254254 // unmount the container's rootfs
0 commit comments