Add NOT operator by parameter in query string
hugomcfonseca opened this issue · comments
Hugo Fonseca commented
Hello, I would like to know if it is possible to use NOT operator (!) using this package.
If not, it would be really useful to start providing it. Thanks.
Examples: GET http://localhost/?status!=1
Will Norris commented
If you just mean including an exclamation point in the mapped URL parameter name, then yes that's possible:
package main
import (
"github.com/google/go-querystring/query"
)
type Options struct {
Status int `url:"status!"`
}
func main() {
v, _ := query.Values(Options{1})
println(v.Encode())
}
Outputs: status%21=1
(%21
is url encoded exclamation).
I'm going to close this, but if you meant something different, feel free to reopen and let me know.