mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-05-13 23:16:45 +00:00
Added common EncodeURLValues function.
This commit is contained in:
@@ -16,6 +16,7 @@ import (
|
||||
"log"
|
||||
"math"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"strings"
|
||||
)
|
||||
|
||||
@@ -259,3 +260,11 @@ func JSONDecode(data []byte, to interface{}) error {
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func EncodeURLValues(url string, values url.Values) string {
|
||||
path := url
|
||||
if len(values) > 0 {
|
||||
path += "?" + values.Encode()
|
||||
}
|
||||
return path
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user