mirror of
https://gitee.com/johng/gf
synced 2026-07-03 20:01:04 +08:00
14 lines
234 B
Go
14 lines
234 B
Go
package gurl
|
|
|
|
import "net/url"
|
|
|
|
// url encode string, is + not %20
|
|
func Encode(str string) string {
|
|
return url.QueryEscape(str)
|
|
}
|
|
|
|
// url decode string
|
|
func Decode(str string) (string, error) {
|
|
return url.QueryUnescape(str)
|
|
}
|