77 "io/ioutil"
88 "net/url"
99 "os"
10- "path"
10+ "path/filepath "
1111 "strings"
1212 "testing"
1313
@@ -105,8 +105,8 @@ func TestOptionParsing(t *testing.T) {
105105 cmds .DelimitedStringsOption ("," , "delimstrings" , "d" , "comma delimited string array" ),
106106 },
107107 Subcommands : map [string ]* cmds.Command {
108- "test" : & cmds. Command {},
109- "defaults" : & cmds. Command {
108+ "test" : {},
109+ "defaults" : {
110110 Options : []cmds.Option {
111111 cmds .StringOption ("opt" , "o" , "an option" ).WithDefault ("def" ),
112112 },
@@ -265,7 +265,7 @@ func TestDefaultOptionParsing(t *testing.T) {
265265
266266 cmd := & cmds.Command {
267267 Subcommands : map [string ]* cmds.Command {
268- "defaults" : & cmds. Command {
268+ "defaults" : {
269269 Options : []cmds.Option {
270270 cmds .StringOption ("string" , "s" , "a string" ).WithDefault ("foo" ),
271271 cmds .StringsOption ("strings1" , "a" , "a string array" ).WithDefault ([]string {"foo" }),
@@ -435,18 +435,18 @@ func TestBodyArgs(t *testing.T) {
435435 cmds .StringArg ("a" , true , true , "some arg" ).EnableStdin (),
436436 },
437437 },
438- "stdinenabled2args" : & cmds. Command {
438+ "stdinenabled2args" : {
439439 Arguments : []cmds.Argument {
440440 cmds .StringArg ("a" , true , false , "some arg" ),
441441 cmds .StringArg ("b" , true , true , "another arg" ).EnableStdin (),
442442 },
443443 },
444- "stdinenablednotvariadic" : & cmds. Command {
444+ "stdinenablednotvariadic" : {
445445 Arguments : []cmds.Argument {
446446 cmds .StringArg ("a" , true , false , "some arg" ).EnableStdin (),
447447 },
448448 },
449- "stdinenablednotvariadic2args" : & cmds. Command {
449+ "stdinenablednotvariadic2args" : {
450450 Arguments : []cmds.Argument {
451451 cmds .StringArg ("a" , true , false , "some arg" ),
452452 cmds .StringArg ("b" , true , false , "another arg" ).EnableStdin (),
@@ -763,7 +763,7 @@ func TestFileArgs(t *testing.T) {
763763 tmpFile1 := mkTempFile (t , "" , "" , "test1" )
764764 tmpFile2 := mkTempFile (t , tmpDir1 , "" , "toBeIgnored" )
765765 tmpFile3 := mkTempFile (t , tmpDir1 , "" , "test3" )
766- ignoreFile := mkTempFile (t , tmpDir2 , "" , path .Base (tmpFile2 .Name ()))
766+ ignoreFile := mkTempFile (t , tmpDir2 , "" , filepath .Base (tmpFile2 .Name ()))
767767 tmpHiddenFile := mkTempFile (t , tmpDir1 , ".test_hidden_file_*" , "test" )
768768 defer func () {
769769 for _ , f := range []string {
@@ -790,27 +790,27 @@ func TestFileArgs(t *testing.T) {
790790 parseErr : fmt .Errorf ("argument %q is required" , "path" ),
791791 },
792792 {
793- cmd : words {"fileOp" , "--ignore" , path .Base (tmpFile2 .Name ()), tmpDir1 , tmpFile1 .Name ()}, f : nil ,
793+ cmd : words {"fileOp" , "--ignore" , filepath .Base (tmpFile2 .Name ()), tmpDir1 , tmpFile1 .Name ()}, f : nil ,
794794 args : words {tmpDir1 , tmpFile1 .Name (), tmpFile3 .Name ()},
795795 parseErr : fmt .Errorf (notRecursiveFmtStr , tmpDir1 , "r" ),
796796 },
797797 {
798- cmd : words {"fileOp" , tmpFile1 .Name (), "--ignore" , path .Base (tmpFile2 .Name ()), "--ignore" }, f : nil ,
798+ cmd : words {"fileOp" , tmpFile1 .Name (), "--ignore" , filepath .Base (tmpFile2 .Name ()), "--ignore" }, f : nil ,
799799 args : words {tmpDir1 , tmpFile1 .Name (), tmpFile3 .Name ()},
800800 parseErr : fmt .Errorf ("missing argument for option %q" , "ignore" ),
801801 },
802802 {
803- cmd : words {"fileOp" , "-r" , "--ignore" , path .Base (tmpFile2 .Name ()), tmpDir1 , tmpFile1 .Name ()}, f : nil ,
803+ cmd : words {"fileOp" , "-r" , "--ignore" , filepath .Base (tmpFile2 .Name ()), tmpDir1 , tmpFile1 .Name ()}, f : nil ,
804804 args : words {tmpDir1 , tmpFile1 .Name (), tmpFile3 .Name ()},
805805 parseErr : nil ,
806806 },
807807 {
808- cmd : words {"fileOp" , "--hidden" , "-r" , "--ignore" , path .Base (tmpFile2 .Name ()), tmpDir1 , tmpFile1 .Name ()}, f : nil ,
808+ cmd : words {"fileOp" , "--hidden" , "-r" , "--ignore" , filepath .Base (tmpFile2 .Name ()), tmpDir1 , tmpFile1 .Name ()}, f : nil ,
809809 args : words {tmpDir1 , tmpFile1 .Name (), tmpFile3 .Name (), tmpHiddenFile .Name ()},
810810 parseErr : nil ,
811811 },
812812 {
813- cmd : words {"fileOp" , "-r" , "--ignore" , path .Base (tmpFile2 .Name ()), tmpDir1 , tmpFile1 .Name (), "--ignore" , "anotherRule" }, f : nil ,
813+ cmd : words {"fileOp" , "-r" , "--ignore" , filepath .Base (tmpFile2 .Name ()), tmpDir1 , tmpFile1 .Name (), "--ignore" , "anotherRule" }, f : nil ,
814814 args : words {tmpDir1 , tmpFile1 .Name (), tmpFile3 .Name ()},
815815 parseErr : nil ,
816816 },
@@ -838,7 +838,7 @@ func TestFileArgs(t *testing.T) {
838838 }
839839 expectedFileMap := make (map [string ]bool )
840840 for _ , arg := range tc .args {
841- expectedFileMap [path .Base (arg )] = false
841+ expectedFileMap [filepath .Base (arg )] = false
842842 }
843843 it := req .Files .Entries ()
844844 for it .Next () {
0 commit comments