- update url
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/tag Build is passing Details

master v1.0.19
李光春 2 years ago
parent 1b52cc3467
commit 21362ffcb4

@ -3,9 +3,15 @@ type: docker
name: clone
steps:
- name: test-golang
- name: Test
image: golang:1.18
commands:
- go env -w GO111MODULE=on
- go env -w GOPROXY=https://goproxy.cn,direct
- go test -v ./...
- go test -v ./...
- name: Benchmark
image: golang:1.18
commands:
- go env -w GO111MODULE=on
- go env -w GOPROXY=https://goproxy.cn,direct
- go test -bench=. -benchmem

@ -16,8 +16,6 @@ import (
"time"
)
const Version = "1.0.18"
var userAgentFormat = "DtApp-Request/%s (%s) GO/%s"
// Response 返回内容

@ -45,3 +45,26 @@ func UriFilterExcludeQueryString(uri string) string {
clearUri = strings.TrimRight(clearUri, "?")
return strings.TrimRight(clearUri, "/")
}
// LenCode 编码
func LenCode(s string) string {
escape := url.QueryEscape(s)
return escape
}
// DeCode 解码
func DeCode(s string) string {
unescape, _ := url.QueryUnescape(s)
return unescape
}
// ParseQuery 获取URL参数 https://studygolang.com/articles/2876
func ParseQuery(s string) map[string][]string {
u, err := url.Parse(s)
if err != nil {
return nil
}
urlParam := u.RawQuery
m, _ := url.ParseQuery(urlParam)
return m
}

@ -0,0 +1,3 @@
package gorequest
const Version = "1.0.19"

@ -0,0 +1,7 @@
package gorequest
import "testing"
func TestVersion(t *testing.T) {
t.Log(Version)
}
Loading…
Cancel
Save