Files
old-backend/services/location/mapbox_lib/values.go
2023-10-12 05:23:34 +02:00

24 lines
448 B
Go

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)
}
}