lishwist/http/file/file.go
2026-02-19 20:16:04 +09:00

15 lines
276 B
Go

package file
import (
"net/http"
"path/filepath"
"strings"
)
func NameAtPathValue(r *http.Request, pathValueName string) (stem string, ext string) {
filename := r.PathValue(pathValueName)
ext = filepath.Ext(filename)
stem = strings.TrimSuffix(filename, ext)
return
}