File tree Expand file tree Collapse file tree 2 files changed +9
-7
lines changed Expand file tree Collapse file tree 2 files changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ import (
23
23
"math/big"
24
24
"os"
25
25
"os/user"
26
- "path"
26
+ "path/filepath "
27
27
"strings"
28
28
29
29
"github.com/ethereum/go-ethereum/common/math"
@@ -319,7 +319,7 @@ func expandPath(p string) string {
319
319
p = home + p [1 :]
320
320
}
321
321
}
322
- return path .Clean (os .ExpandEnv (p ))
322
+ return filepath .Clean (os .ExpandEnv (p ))
323
323
}
324
324
325
325
func HomeDir () string {
Original file line number Diff line number Diff line change @@ -25,11 +25,13 @@ import (
25
25
func TestPathExpansion (t * testing.T ) {
26
26
user , _ := user .Current ()
27
27
tests := map [string ]string {
28
- "/home/someuser/tmp" : "/home/someuser/tmp" ,
29
- "~/tmp" : user .HomeDir + "/tmp" ,
30
- "~thisOtherUser/b/" : "~thisOtherUser/b" ,
31
- "$DDDXXX/a/b" : "/tmp/a/b" ,
32
- "/a/b/" : "/a/b" ,
28
+ "/home/someuser/tmp" : "/home/someuser/tmp" ,
29
+ "~/tmp" : user .HomeDir + "/tmp" ,
30
+ "~thisOtherUser/b/" : "~thisOtherUser/b" ,
31
+ "$DDDXXX/a/b" : "/tmp/a/b" ,
32
+ "/a/b/" : "/a/b" ,
33
+ "C:\\ Documents\\ Newsletters\\ " : "C:\\ Documents\\ Newsletters\\ " ,
34
+ "C:\\ " : "C:\\ " ,
33
35
}
34
36
os .Setenv ("DDDXXX" , "/tmp" )
35
37
for test , expected := range tests {
You can’t perform that action at this time.
0 commit comments