We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d189839 commit 5aa29e8Copy full SHA for 5aa29e8
path.go
@@ -41,7 +41,7 @@ func CleanPath(p string) string {
41
buf[0] = '/'
42
}
43
44
- trailing := n > 2 && p[n-1] == '/'
+ trailing := n > 1 && p[n-1] == '/'
45
46
// A bit more clunky without a 'lazybuf' like the path package, but the loop
47
// gets completely inlined (bufApp). So in contrast to the path package this
path_test.go
@@ -22,6 +22,7 @@ var cleanTests = []struct {
22
23
// missing root
24
{"", "/"},
25
+ {"a/", "/a/"},
26
{"abc", "/abc"},
27
{"abc/def", "/abc/def"},
28
{"a/b/c", "/a/b/c"},
0 commit comments