| name | code-review |
| description | Standards for reviewing Go code changes in this project. Use when asked to review code, check changes, or validate pull requests. Use when this capability is needed. |
| metadata | {"author":"feraudet"} |
Code Review Standards
Checklist
Security
Go Idioms
HTTP Handler Quality
Markdown Parser
Performance
Common Issues
Path Security
http.ServeFile(w, r, r.URL.Query().Get("path"))
path := filepath.Clean(r.URL.Query().Get("path"))
info, err := os.Stat(path)
if err != nil || info.IsDir() {
http.Error(w, "Not found", 404)
return
}
http.ServeFile(w, r, path)
HTML Escaping
fmt.Sprintf("<p>%s</p>", userContent)
fmt.Sprintf("<p>%s</p>", html.EscapeString(userContent))
Review Commands
grep -n 'fmt.Sprintf.*<' main.go | grep -v 'EscapeString'
grep -n 'os.Stat\|os.ReadFile\|http.ServeFile' main.go
Converted and distributed by TomeVault — claim your Tome and manage your conversions.