Files

12 lines
212 B
Go
Raw Permalink Normal View History

2022-04-14 07:53:53 +00:00
package net
import (
"net/url"
)
// EncodePath encodes the path of a url.
//
// slashes (/) are treated as path-separators.
func EncodePath(path string) string {
return (&url.URL{Path: path}).EscapedPath()
}