17 lines
244 B
Go
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))
|
|
}
|
|
|