Skip to content

Commit

Permalink
rename
Browse files Browse the repository at this point in the history
  • Loading branch information
AsterDY committed Jan 14, 2024
1 parent 7687283 commit 84d69d2
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions ast/raw.go
Original file line number Diff line number Diff line change
Expand Up @@ -482,13 +482,13 @@ func (self Value) Array() (ret []interface{}, err error) {

// ObjectUseNode scans both parsed and non-parsed chidren nodes,
// and map them by their keys
func (self Value) MapUseNode() (ret []RawPair, err error) {
func (self Value) MapUseNode() (ret []KeyVal, err error) {
if self.t != V_OBJECT {
return nil, ErrUnsupportType
}
ret = make([]RawPair, 0, _DEFAULT_NODE_CAP)
ret = make([]KeyVal, 0, _DEFAULT_NODE_CAP)
err = self.ForEachKV(func(key string, node Value) bool {
ret = append(ret, RawPair{key, node})
ret = append(ret, KeyVal{key, node})
return true
})
return ret, err
Expand Down Expand Up @@ -607,8 +607,8 @@ func (self Value) ForEachElem(sc func(i int, node Value) bool) error {
}
}

// RawPair is a pair of key and value (RawNode)
type RawPair struct {
// KeyVal is a pair of key and value (RawNode)
type KeyVal struct {
Key string
Value Value
}
Expand Down

0 comments on commit 84d69d2

Please sign in to comment.