Update QueryEscape documentation
This commit is contained in:
parent
35836f2ff7
commit
d52d0af783
5
query.go
5
query.go
@ -5,8 +5,9 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
// QueryEscape properly escapes a string for use in a Gemini URL query.
|
// 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.
|
// It is like url.PathEscape except that it also replaces plus signs
|
||||||
|
// with their percent-encoded counterpart.
|
||||||
func QueryEscape(query string) string {
|
func QueryEscape(query string) string {
|
||||||
return strings.ReplaceAll(url.PathEscape(query), "+", "%2B")
|
return strings.ReplaceAll(url.PathEscape(query), "+", "%2B")
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user