15 lines
276 B
Go
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
|
|
}
|