File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ import (
2828)
2929
3030func main () {
31- result , err := goqs.DecodeQuery (" user[name]=Alice&user[age]=30" , nil )
31+ result , err := goqs.Parse (" user[name]=Alice&user[age]=30" , nil )
3232 if err != nil {
3333 panic (err)
3434 }
@@ -57,7 +57,7 @@ opts := &goqs.ParseOptions{
5757 Depth : 5 ,
5858 // ...other options
5959}
60- result , err := goqs.DecodeQuery (" a.b=1&a.c=2" , opts)
60+ result , err := goqs.Parse (" a.b=1&a.c=2" , opts)
6161```
6262
6363See [ ParseOptions] ( https://pkg.go.dev/github.com/globocom/go-qs#ParseOptions ) for all available fields.
Original file line number Diff line number Diff line change @@ -207,7 +207,7 @@ func EscapeQueryString(rawQuery string) string {
207207 return strings .Join (parts , "&" )
208208}
209209
210- func DecodeQuery (str string , opts * ParseOptions ) (result map [string ]interface {}, err error ) {
210+ func Parse (str string , opts * ParseOptions ) (result map [string ]interface {}, err error ) {
211211 defer func () {
212212 if r := recover (); r != nil {
213213 switch v := r .(type ) {
Original file line number Diff line number Diff line change @@ -61,7 +61,7 @@ func TestDecodeQueryFormats(t *testing.T) {
6161
6262 for _ , tt := range tests {
6363 t .Run (tt .name , func (t * testing.T ) {
64- res , err := DecodeQuery (tt .query , & ParseOptions {
64+ res , err := Parse (tt .query , & ParseOptions {
6565 AllowDots : false ,
6666 AllowEmptyArrays : false ,
6767 AllowPrototypes : false ,
You can’t perform that action at this time.
0 commit comments