lishwist/http/file/file.go
2025-12-16 00:38:05 +09:00

17 lines
244 B
Go

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))
}