claude code review changes

This commit is contained in:
2026-02-20 17:05:34 +05:30
parent 136957d75d
commit f1c5b9587b
9 changed files with 151 additions and 130 deletions

View File

@@ -27,7 +27,7 @@ func (m *Mux) Resource(pattern string, fn func(res *Resource), mw ...func(http.H
}
if strings.TrimSpace(pattern) == "" {
panic("mux: Resource() requires a patter to work")
panic("mux: Resource() requires a pattern to work")
}
if fn == nil {
@@ -215,11 +215,9 @@ func (res *Resource) Use(middlewares ...func(http.Handler) http.Handler) {
}
func suffixIt(str, suffix string) string {
var p strings.Builder
p.WriteString(str)
if !strings.HasSuffix(str, "/") {
p.WriteString("/")
if strings.HasSuffix(str, "/") {
return str + suffix
}
p.WriteString(suffix)
return p.String()
return str + "/" + suffix
}