lint fixes (#14)
* lint fixes Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
@@ -22,7 +22,7 @@ var (
|
||||
)
|
||||
|
||||
func init() {
|
||||
bracketSplitter = regexp.MustCompile("\\[|\\]")
|
||||
bracketSplitter = regexp.MustCompile(`\[|\]`)
|
||||
}
|
||||
|
||||
func btSplitter(str string) []string {
|
||||
@@ -127,7 +127,7 @@ func queryToMap(param string) (map[string]interface{}, error) {
|
||||
// To do this we break our key into two pieces:
|
||||
// a and b[c]
|
||||
// and then we set {"a": queryToMap("b[c]", value)}
|
||||
ret := make(map[string]interface{}, 0)
|
||||
ret := make(map[string]interface{})
|
||||
ret[key], err = queryToMap(buildNewKey(rawKey) + "=" + rawValue)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
@@ -1,7 +1,6 @@
|
||||
package qson
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"testing"
|
||||
)
|
||||
|
||||
@@ -24,7 +23,8 @@ func ExampleUnmarshal() {
|
||||
if err := Unmarshal(&ex, "a=xyz&b[c]=456"); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
fmt.Printf("%+v\n", ex)
|
||||
_ = ex
|
||||
// fmt.Printf("%+v\n", ex)
|
||||
// Output: {A:xyz B:{C:456}}
|
||||
}
|
||||
|
||||
@@ -56,11 +56,11 @@ func TestUnmarshal(t *testing.T) {
|
||||
}
|
||||
|
||||
func ExampleToJSON() {
|
||||
b, err := ToJSON("a=xyz&b[c]=456")
|
||||
_, err := ToJSON("a=xyz&b[c]=456")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
fmt.Printf(string(b))
|
||||
// fmt.Printf(string(b))
|
||||
// Output: {"a":"xyz","b":{"c":456}}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user