@@ -23,7 +23,6 @@ import (
2323 "io/ioutil"
2424 "os"
2525 "os/user"
26- "path"
2726 "path/filepath"
2827 "runtime"
2928 "runtime/pprof"
@@ -384,7 +383,7 @@ func exec(t *testing.T, ctx *context, cmd []string) {
384383 case "log" :
385384 writer , exists := ctx .logFileWriters [cmd [2 ]]
386385 if ! exists {
387- writer = newLogFileWriter (t , ctx , path .Join (ctx .basedir , cmd [2 ]))
386+ writer = newLogFileWriter (t , ctx , filepath .Join (ctx .basedir , cmd [2 ]))
388387 ctx .logFileWriters [cmd [2 ]] = writer
389388 }
390389 writer .writeLine (t , ctx , cmd [1 ])
@@ -406,7 +405,7 @@ func exec(t *testing.T, ctx *context, cmd []string) {
406405}
407406
408407func rotate (t * testing.T , ctx * context , from string , to string ) {
409- fullpath := path .Join (ctx .basedir , from )
408+ fullpath := filepath .Join (ctx .basedir , from )
410409 fromDir := filepath .Dir (fullpath )
411410 filenameFrom := filepath .Base (fullpath )
412411 filesBefore := ls (t , ctx , fromDir )
@@ -463,7 +462,7 @@ func containsFile(files []os.FileInfo, filename string) bool {
463462}
464463
465464func moveOrFail (t * testing.T , ctx * context , from , to string ) {
466- fromPath := path .Join (ctx .basedir , from )
465+ fromPath := filepath .Join (ctx .basedir , from )
467466 fromDir := filepath .Dir (fromPath )
468467 fromFilename := filepath .Base (fromPath )
469468 switch {
@@ -494,17 +493,17 @@ func filenames(fileInfos []os.FileInfo) []string {
494493}
495494
496495func mvOrFail (t * testing.T , ctx * context , from , to string ) {
497- fromPath := path .Join (ctx .basedir , from )
498- toPath := path .Join (ctx .basedir , to )
496+ fromPath := filepath .Join (ctx .basedir , from )
497+ toPath := filepath .Join (ctx .basedir , to )
499498 err := os .Rename (fromPath , toPath )
500499 if err != nil {
501500 fatalf (t , ctx , "%v: Failed to mv file: %v" , fromPath , err .Error ())
502501 }
503502}
504503
505504func cpOrFail (t * testing.T , ctx * context , from , to string ) {
506- fromPath := path .Join (ctx .basedir , from )
507- toPath := path .Join (ctx .basedir , to )
505+ fromPath := filepath .Join (ctx .basedir , from )
506+ toPath := filepath .Join (ctx .basedir , to )
508507 data , err := ioutil .ReadFile (fromPath )
509508 if err != nil {
510509 fatalf (t , ctx , "%v: Copy failed, cannot read file: %v" , fromPath , err .Error ())
@@ -516,15 +515,15 @@ func cpOrFail(t *testing.T, ctx *context, from, to string) {
516515}
517516
518517func rmOrFail (t * testing.T , ctx * context , from string ) {
519- fromPath := path .Join (ctx .basedir , from )
518+ fromPath := filepath .Join (ctx .basedir , from )
520519 err := os .Remove (fromPath )
521520 if err != nil {
522521 fatalf (t , ctx , "%v: Remove failed: %v" , fromPath , err .Error ())
523522 }
524523}
525524
526525func createOrFail (t * testing.T , ctx * context , from string ) {
527- fromPath := path .Join (ctx .basedir , from )
526+ fromPath := filepath .Join (ctx .basedir , from )
528527 dir := filepath .Dir (fromPath )
529528 filename := filepath .Base (fromPath )
530529 filesBeforeCreate := ls (t , ctx , dir )
@@ -546,7 +545,7 @@ func createOrFail(t *testing.T, ctx *context, from string) {
546545}
547546
548547func createFromTemp (t * testing.T , ctx * context , from string ) {
549- fromPath := path .Join (ctx .basedir , from )
548+ fromPath := filepath .Join (ctx .basedir , from )
550549 dir := filepath .Dir (fromPath )
551550 filename := filepath .Base (fromPath )
552551 filesBeforeCreate := ls (t , ctx , dir )
@@ -573,7 +572,7 @@ func createFromTemp(t *testing.T, ctx *context, from string) {
573572}
574573
575574func truncateOrFail (t * testing.T , ctx * context , from string ) {
576- fromPath := path .Join (ctx .basedir , from )
575+ fromPath := filepath .Join (ctx .basedir , from )
577576 err := os .Truncate (fromPath , 0 )
578577 if err != nil {
579578 fatalf (t , ctx , "%v: Error truncating the file: %v" , from , err .Error ())
@@ -585,7 +584,7 @@ func mkdir(t *testing.T, ctx *context, dirname string) {
585584 fullpath string
586585 err error
587586 )
588- fullpath = path .Join (ctx .basedir , dirname )
587+ fullpath = filepath .Join (ctx .basedir , dirname )
589588 if _ , err = os .Stat (fullpath ); ! os .IsNotExist (err ) {
590589 fatalf (t , ctx , "mkdir %v failed: directory already exists" , dirname )
591590 }
@@ -845,7 +844,7 @@ func deleteRecursively(t *testing.T, ctx *context, file string) {
845844 }
846845 if fileInfo .IsDir () {
847846 for _ , childInfo := range ls (t , ctx , file ) {
848- deleteRecursively (t , ctx , path .Join (file , childInfo .Name ()))
847+ deleteRecursively (t , ctx , filepath .Join (file , childInfo .Name ()))
849848 }
850849 }
851850 ctx .log .Debugf ("tearDown: removing %q" , file )
@@ -938,7 +937,7 @@ func runTestShutdown(t *testing.T, mode string) {
938937 nGoroutinesBefore := runtime .NumGoroutine ()
939938
940939 ctx := setUp (t , "test shutdown while " + mode , closeFileAfterEachLine , fseventTailer , _nocreate , mv )
941- writer := newLogFileWriter (t , ctx , path .Join (ctx .basedir , "test.log" ))
940+ writer := newLogFileWriter (t , ctx , filepath .Join (ctx .basedir , "test.log" ))
942941 writer .writeLine (t , ctx , "line 1" )
943942
944943 parsedGlob , err := glob .Parse (filepath .Join (ctx .basedir , "test.log" ))
0 commit comments