Browse code

Fixups for 39695 - edit comments, redundant lines

1. Modify comments added in 5858a99267822b93e2d304d876bab84d05b227c6
Windows Volume GUID path format is: \\?\Volume{<GUID Value>}\<path>
Rewrote the example given in comments to conform to the format..

2. Remove two redundant asserts[assert.NilError]. They are redundant
because the last statement will not change the value of err.

Signed-off-by: Vikram bir Singh <vikrambir.singh@docker.com>

Vikram bir Singh authored on 2019/08/16 03:48:21
Showing 2 changed files
... ...
@@ -559,7 +559,10 @@ func copyFile(archiver Archiver, source, dest *copyEndpoint, identity *idtools.I
559 559
 		// Normal containers
560 560
 		if identity == nil {
561 561
 			// Use system.MkdirAll here, which is a custom version of os.MkdirAll
562
-			// modified for use on Windows to handle volume GUID paths (\\?\{dae8d3ac-b9a1-11e9-88eb-e8554b2ba1db}\path\)
562
+			// modified for use on Windows to handle volume GUID paths. These paths
563
+			// are of the form \\?\Volume{<GUID>}\<path>. An example would be:
564
+			// \\?\Volume{dae8d3ac-b9a1-11e9-88eb-e8554b2ba1db}\bin\busybox.exe
565
+
563 566
 			if err := system.MkdirAll(filepath.Dir(dest.path), 0755, ""); err != nil {
564 567
 				return err
565 568
 			}
... ...
@@ -170,7 +170,6 @@ func TestBuildMultiStageCopy(t *testing.T) {
170 170
 			assert.NilError(t, err)
171 171
 
172 172
 			out := bytes.NewBuffer(nil)
173
-			assert.NilError(t, err)
174 173
 			_, err = io.Copy(out, resp.Body)
175 174
 			_ = resp.Body.Close()
176 175
 			if err != nil {
... ...
@@ -604,7 +603,6 @@ func TestBuildPreserveOwnership(t *testing.T) {
604 604
 			assert.NilError(t, err)
605 605
 
606 606
 			out := bytes.NewBuffer(nil)
607
-			assert.NilError(t, err)
608 607
 			_, err = io.Copy(out, resp.Body)
609 608
 			_ = resp.Body.Close()
610 609
 			if err != nil {