Skip to content

Commit 10121a4

Browse files
committed
Fix typo
1 parent eea28e9 commit 10121a4

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

helper.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ type sortMap struct {
106106
data interface{}
107107
key string
108108
desc bool
109-
seperator string
109+
separator string
110110
errs []error
111111
}
112112

@@ -142,11 +142,11 @@ func (s *sortMap) Less(i, j int) (res bool) {
142142

143143
// compare nested values
144144
if strings.Contains(s.key, ".") {
145-
xv, errX := getNestedValue(x, s.key, s.seperator)
145+
xv, errX := getNestedValue(x, s.key, s.separator)
146146
if errX != nil {
147147
s.errs = append(s.errs, errX)
148148
}
149-
yv, errY := getNestedValue(y, s.key, s.seperator)
149+
yv, errY := getNestedValue(y, s.key, s.separator)
150150
if errY != nil {
151151
s.errs = append(s.errs, errY)
152152
}
@@ -190,8 +190,8 @@ func (s *sortMap) compare(x, y interface{}) (res bool) {
190190
}
191191

192192
// getNestedValue fetch nested value from node
193-
func getNestedValue(input interface{}, node, seperator string) (interface{}, error) {
194-
pp := strings.Split(node, seperator)
193+
func getNestedValue(input interface{}, node, separator string) (interface{}, error) {
194+
pp := strings.Split(node, separator)
195195
for _, n := range pp {
196196
if isIndex(n) {
197197
// find slice/array

jsonq.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ func (j *JSONQ) sortBy(property string, asc bool) *JSONQ {
425425
}
426426

427427
sm := &sortMap{}
428-
sm.seperator = j.option.separator
428+
sm.separator = j.option.separator
429429
sm.key = property
430430
if !asc {
431431
sm.desc = true

option.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ func SetDecoder(u Decoder) OptionFunc {
2222
}
2323
}
2424

25-
// SetSeparator set custom seperator for traversing child node, default seperator is DOT (.)
25+
// SetSeparator set custom separator for traversing child node, default separator is DOT (.)
2626
func SetSeparator(s string) OptionFunc {
2727
return func(j *JSONQ) error {
2828
if s == "" {

0 commit comments

Comments
 (0)