Преглед изворни кода

Use filepath.IsAbs to see if temp directory is local. Fixes a problem on Windows, since the old code assumed a rooted path starts with /.

Rob Pike пре 12 година
родитељ
комит
496d3b747b
1 измењених фајлова са 2 додато и 1 уклоњено
  1. 2 1
      glog_file.go

+ 2 - 1
glog_file.go

@@ -25,6 +25,7 @@ import (
 	"os"
 	"os/user"
 	"path"
+	"path/filepath"
 	"strings"
 	"sync"
 	"time"
@@ -55,7 +56,7 @@ func createLogDirs() {
 		if len(dir) == 0 {
 			continue
 		}
-		if dir[0] != '/' {
+		if !filepath.IsAbs(dir) {
 			dir = "/" + dir
 		}
 		logDirs = append(logDirs, dir)