mirror of
https://github.com/mikefarah/yq.git
synced 2024-11-13 22:38:04 +00:00
21 lines
563 B
Go
21 lines
563 B
Go
package yqlib
|
|
|
|
import "container/list"
|
|
|
|
func NotOperator(d *dataTreeNavigator, matchMap *list.List, pathNode *PathTreeNode) (*list.List, error) {
|
|
log.Debugf("-- notOperation")
|
|
var results = list.New()
|
|
|
|
for el := matchMap.Front(); el != nil; el = el.Next() {
|
|
candidate := el.Value.(*CandidateNode)
|
|
log.Debug("notOperation checking %v", candidate)
|
|
truthy, errDecoding := isTruthy(candidate)
|
|
if errDecoding != nil {
|
|
return nil, errDecoding
|
|
}
|
|
result := createBooleanCandidate(candidate, !truthy)
|
|
results.PushBack(result)
|
|
}
|
|
return results, nil
|
|
}
|