1
0
Fork 0
mirror of https://git.sr.ht/~adnano/go-gemini synced 2024-05-13 23:56:05 +02:00

Update QueryEscape documentation

This commit is contained in:
Adnan Maolood 2020-12-18 00:26:47 -05:00
parent 35836f2ff7
commit d52d0af783

View File

@ -5,8 +5,9 @@ import (
"strings"
)
// QueryEscape properly escapes a string for use in a Gemini URL query.
// It is like url.PathEscape except that it also replaces plus signs with their percent-encoded counterpart.
// QueryEscape escapes a string for use in a Gemini URL query.
// It is like url.PathEscape except that it also replaces plus signs
// with their percent-encoded counterpart.
func QueryEscape(query string) string {
return strings.ReplaceAll(url.PathEscape(query), "+", "%2B")
}