@@ -30,11 +30,11 @@ func TestCpGarbagePath(t *testing.T) {
3030 t .Fatal ("failed to create a container" , out , err )
3131 }
3232
33- cleanedContainerID := stripTrailingCharacters (out )
33+ cleanedContainerID := strings . TrimSpace (out )
3434 defer deleteContainer (cleanedContainerID )
3535
3636 out , _ , err = dockerCmd (t , "wait" , cleanedContainerID )
37- if err != nil || stripTrailingCharacters (out ) != "0" {
37+ if err != nil || strings . TrimSpace (out ) != "0" {
3838 t .Fatal ("failed to set up container" , out , err )
3939 }
4040
@@ -92,11 +92,11 @@ func TestCpRelativePath(t *testing.T) {
9292 t .Fatal ("failed to create a container" , out , err )
9393 }
9494
95- cleanedContainerID := stripTrailingCharacters (out )
95+ cleanedContainerID := strings . TrimSpace (out )
9696 defer deleteContainer (cleanedContainerID )
9797
9898 out , _ , err = dockerCmd (t , "wait" , cleanedContainerID )
99- if err != nil || stripTrailingCharacters (out ) != "0" {
99+ if err != nil || strings . TrimSpace (out ) != "0" {
100100 t .Fatal ("failed to set up container" , out , err )
101101 }
102102
@@ -162,11 +162,11 @@ func TestCpAbsolutePath(t *testing.T) {
162162 t .Fatal ("failed to create a container" , out , err )
163163 }
164164
165- cleanedContainerID := stripTrailingCharacters (out )
165+ cleanedContainerID := strings . TrimSpace (out )
166166 defer deleteContainer (cleanedContainerID )
167167
168168 out , _ , err = dockerCmd (t , "wait" , cleanedContainerID )
169- if err != nil || stripTrailingCharacters (out ) != "0" {
169+ if err != nil || strings . TrimSpace (out ) != "0" {
170170 t .Fatal ("failed to set up container" , out , err )
171171 }
172172
@@ -226,11 +226,11 @@ func TestCpAbsoluteSymlink(t *testing.T) {
226226 t .Fatal ("failed to create a container" , out , err )
227227 }
228228
229- cleanedContainerID := stripTrailingCharacters (out )
229+ cleanedContainerID := strings . TrimSpace (out )
230230 defer deleteContainer (cleanedContainerID )
231231
232232 out , _ , err = dockerCmd (t , "wait" , cleanedContainerID )
233- if err != nil || stripTrailingCharacters (out ) != "0" {
233+ if err != nil || strings . TrimSpace (out ) != "0" {
234234 t .Fatal ("failed to set up container" , out , err )
235235 }
236236
@@ -290,11 +290,11 @@ func TestCpSymlinkComponent(t *testing.T) {
290290 t .Fatal ("failed to create a container" , out , err )
291291 }
292292
293- cleanedContainerID := stripTrailingCharacters (out )
293+ cleanedContainerID := strings . TrimSpace (out )
294294 defer deleteContainer (cleanedContainerID )
295295
296296 out , _ , err = dockerCmd (t , "wait" , cleanedContainerID )
297- if err != nil || stripTrailingCharacters (out ) != "0" {
297+ if err != nil || strings . TrimSpace (out ) != "0" {
298298 t .Fatal ("failed to set up container" , out , err )
299299 }
300300
@@ -355,11 +355,11 @@ func TestCpUnprivilegedUser(t *testing.T) {
355355 t .Fatal ("failed to create a container" , out , err )
356356 }
357357
358- cleanedContainerID := stripTrailingCharacters (out )
358+ cleanedContainerID := strings . TrimSpace (out )
359359 defer deleteContainer (cleanedContainerID )
360360
361361 out , _ , err = dockerCmd (t , "wait" , cleanedContainerID )
362- if err != nil || stripTrailingCharacters (out ) != "0" {
362+ if err != nil || strings . TrimSpace (out ) != "0" {
363363 t .Fatal ("failed to set up container" , out , err )
364364 }
365365
@@ -398,11 +398,11 @@ func TestCpSpecialFiles(t *testing.T) {
398398 t .Fatal ("failed to create a container" , out , err )
399399 }
400400
401- cleanedContainerID := stripTrailingCharacters (out )
401+ cleanedContainerID := strings . TrimSpace (out )
402402 defer deleteContainer (cleanedContainerID )
403403
404404 out , _ , err = dockerCmd (t , "wait" , cleanedContainerID )
405- if err != nil || stripTrailingCharacters (out ) != "0" {
405+ if err != nil || strings . TrimSpace (out ) != "0" {
406406 t .Fatal ("failed to set up container" , out , err )
407407 }
408408
@@ -471,11 +471,11 @@ func TestCpVolumePath(t *testing.T) {
471471 t .Fatal ("failed to create a container" , out , err )
472472 }
473473
474- cleanedContainerID := stripTrailingCharacters (out )
474+ cleanedContainerID := strings . TrimSpace (out )
475475 defer deleteContainer (cleanedContainerID )
476476
477477 out , _ , err = dockerCmd (t , "wait" , cleanedContainerID )
478- if err != nil || stripTrailingCharacters (out ) != "0" {
478+ if err != nil || strings . TrimSpace (out ) != "0" {
479479 t .Fatal ("failed to set up container" , out , err )
480480 }
481481
@@ -562,11 +562,11 @@ func TestCpToDot(t *testing.T) {
562562 t .Fatal ("failed to create a container" , out , err )
563563 }
564564
565- cleanedContainerID := stripTrailingCharacters (out )
565+ cleanedContainerID := strings . TrimSpace (out )
566566 defer deleteContainer (cleanedContainerID )
567567
568568 out , _ , err = dockerCmd (t , "wait" , cleanedContainerID )
569- if err != nil || stripTrailingCharacters (out ) != "0" {
569+ if err != nil || strings . TrimSpace (out ) != "0" {
570570 t .Fatal ("failed to set up container" , out , err )
571571 }
572572
@@ -600,11 +600,11 @@ func TestCpToStdout(t *testing.T) {
600600 t .Fatalf ("failed to create a container:%s\n %s" , out , err )
601601 }
602602
603- cID := stripTrailingCharacters (out )
603+ cID := strings . TrimSpace (out )
604604 defer deleteContainer (cID )
605605
606606 out , _ , err = dockerCmd (t , "wait" , cID )
607- if err != nil || stripTrailingCharacters (out ) != "0" {
607+ if err != nil || strings . TrimSpace (out ) != "0" {
608608 t .Fatalf ("failed to set up container:%s\n %s" , out , err )
609609 }
610610
0 commit comments