@@ -27,14 +27,15 @@ const (
2727)
2828
2929// If isPath is true:
30- // We remove redundant '/'s, the leading '/', and trailing '/'.
31- // If the result is empty, a '/' is inserted.
30+ //
31+ // We remove redundant '/'s, the leading '/', and trailing '/'.
32+ // If the result is empty, a '/' is inserted.
3233//
3334// We always:
34- // Replace the following characters with `\x%x`:
35- // Leading `.`
36- // `-`, `\`, and anything not in this set: `:-_.\[0-9a-zA-Z]`
37- // Replace '/' with '-'.
35+ //
36+ // Replace the following characters with `\x%x`: Leading `.`,
37+ // `-`, `\`, and anything not in this set: `:-_.\[0-9a-zA-Z]`
38+ // Replace '/' with '-'.
3839func escape (unescaped string , isPath bool ) string {
3940 e := []byte {}
4041 inSlashes := false
@@ -69,11 +70,13 @@ func escape(unescaped string, isPath bool) string {
6970}
7071
7172// If isPath is true:
72- // We always return a string beginning with '/'.
73+ //
74+ // We always return a string beginning with '/'.
7375//
7476// We always:
75- // Replace '-' with '/'.
76- // Replace `\x%x` with the value represented in hex.
77+ //
78+ // Replace '-' with '/'.
79+ // Replace `\x%x` with the value represented in hex.
7780func unescape (escaped string , isPath bool ) string {
7881 u := []byte {}
7982 for i := 0 ; i < len (escaped ); i ++ {
0 commit comments