upstream sync
This commit is contained in:
23
services/location/mapbox_lib/values.go
Normal file
23
services/location/mapbox_lib/values.go
Normal file
@@ -0,0 +1,23 @@
|
||||
package mapbox
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
)
|
||||
|
||||
const (
|
||||
slash = "/"
|
||||
comma = ','
|
||||
questionMark = "?"
|
||||
equalMark = '='
|
||||
ampersandMark = '&'
|
||||
)
|
||||
|
||||
// encodeValues do almost the same as url.Values.Encode() but faster and reuses *strings.Builder
|
||||
func encodeValues(buf *bytes.Buffer, values map[string]string) {
|
||||
for k, v := range values {
|
||||
buf.WriteByte(ampersandMark)
|
||||
buf.WriteString(k)
|
||||
buf.WriteByte(equalMark)
|
||||
buf.WriteString(v)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user