package file import ( "net/http" "path/filepath" ) func Stem(path string) string { ext := filepath.Ext(path) return path[:len(path)-len(ext)] } func StemPathValue(r *http.Request, name string) string { return Stem(r.PathValue(name)) }