Drop all calls to IsEmpty.

This commit is contained in:
jregan
2020-08-09 10:39:04 -07:00
parent 2da8959198
commit 31c59bd7f2
14 changed files with 39 additions and 55 deletions

View File

@@ -51,7 +51,7 @@ func (l *Walker) walkAssociativeSequence() (*yaml.RNode, error) {
if err != nil {
return nil, err
}
if yaml.IsEmpty(val) || yaml.IsEmptyMap(val) {
if yaml.IsMissingOrNull(val) || yaml.IsEmptyMap(val) {
_, err = dest.Pipe(yaml.ElementSetter{Key: key, Value: value})
if err != nil {
return nil, err
@@ -74,7 +74,7 @@ func (l *Walker) walkAssociativeSequence() (*yaml.RNode, error) {
}
}
// field is empty
if yaml.IsEmpty(dest) {
if yaml.IsMissingOrNull(dest) {
return nil, nil
}
return dest, nil
@@ -97,7 +97,7 @@ func (l *Walker) walkAssociativeSequence() (*yaml.RNode, error) {
if err != nil {
return nil, err
}
if yaml.IsEmpty(val) {
if yaml.IsMissingOrNull(val) {
_, err = dest.Pipe(yaml.ElementSetter{Key: key, Value: value})
if err != nil {
return nil, err
@@ -121,7 +121,7 @@ func (l *Walker) walkAssociativeSequence() (*yaml.RNode, error) {
}
// field is empty
if yaml.IsEmpty(dest) {
if yaml.IsMissingOrNull(dest) {
return nil, nil
}
return dest, nil