mirror of
https://github.com/mikefarah/yq.git
synced 2026-09-05 00:54:51 +08:00
Fixed length of null to be zero
This commit is contained in:
@@ -17,7 +17,11 @@ func lengthOperator(d *dataTreeNavigator, matchMap *list.List, expressionNode *E
|
||||
var length int
|
||||
switch targetNode.Kind {
|
||||
case yaml.ScalarNode:
|
||||
length = len(targetNode.Value)
|
||||
if targetNode.Tag == "!!null" {
|
||||
length = 0
|
||||
} else {
|
||||
length = len(targetNode.Value)
|
||||
}
|
||||
case yaml.MappingNode:
|
||||
length = len(targetNode.Content) / 2
|
||||
case yaml.SequenceNode:
|
||||
|
||||
Reference in New Issue
Block a user