blob: e8704a7b6f4179a378ffb5e635227f1ce59c277e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
// SPDX-FileCopyrightText: 2026 Stefan Majewsky <majewsky@gmx.net>
// SPDX-License-Identifier: Apache-2.0
package pathrouter
import (
"fmt"
"net/url"
)
func pathUnescape(in string) string {
out, err := url.PathUnescape(in)
if err != nil {
// defense in depth: should not fail because `in` was indirectly obtained from r.URL.EscapedPath()
panic(fmt.Sprintf("PathUnescape failed on %q: %s", in, err.Error()))
}
return out
}
func increment(x int) int {
return x + 1
}
|