Skip to content

Commit 7e1e8d1

Browse files
authored
Merge pull request buger#59 from pendo-io/gofmt-things
Fix formatting with gofmt
2 parents 16b91a7 + d780fbe commit 7e1e8d1

2 files changed

Lines changed: 8 additions & 7 deletions

File tree

parser.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -183,8 +183,9 @@ func searchKeys(data []byte, keys ...string) int {
183183
}
184184

185185
var bitwiseFlags []int64
186+
186187
func init() {
187-
for i:=0; i<63; i++ {
188+
for i := 0; i < 63; i++ {
188189
bitwiseFlags = append(bitwiseFlags, int64(math.Pow(2, float64(i))))
189190
}
190191
}
@@ -252,7 +253,7 @@ func EachKey(data []byte, cb func(int, []byte, ValueType, error), paths ...[]str
252253
}
253254

254255
for pi, p := range paths {
255-
if len(p) < level || (pathFlags & bitwiseFlags[pi]) != 0 || (ignorePathFlags & bitwiseFlags[pi] != 0) {
256+
if len(p) < level || (pathFlags&bitwiseFlags[pi]) != 0 || (ignorePathFlags&bitwiseFlags[pi] != 0) {
256257
continue
257258
}
258259

@@ -295,7 +296,7 @@ func EachKey(data []byte, cb func(int, []byte, ValueType, error), paths ...[]str
295296
continue
296297
}
297298

298-
if len(p) < level || (pathFlags & bitwiseFlags[pi]) != 0 || (ignorePathFlags & bitwiseFlags[pi] != 0) {
299+
if len(p) < level || (pathFlags&bitwiseFlags[pi]) != 0 || (ignorePathFlags&bitwiseFlags[pi] != 0) {
299300
continue
300301
}
301302

parser_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -306,9 +306,9 @@ var getTests = []GetTest{
306306
isErr: true,
307307
},
308308
GetTest{
309-
desc: `malformed array (no closing brace)`,
310-
json: `{"a":[, "b":123}`,
311-
path: []string{"b"},
309+
desc: `malformed array (no closing brace)`,
310+
json: `{"a":[, "b":123}`,
311+
path: []string{"b"},
312312
isFound: false,
313313
},
314314

@@ -664,7 +664,7 @@ func TestEachKey(t *testing.T) {
664664

665665
keysFound := 0
666666

667-
EachKey(testJson, func(idx int, value []byte, vt ValueType, err error){
667+
EachKey(testJson, func(idx int, value []byte, vt ValueType, err error) {
668668
keysFound++
669669

670670
switch idx {

0 commit comments

Comments
 (0)