@@ -24,15 +24,15 @@ type removingWalker struct {
2424 out interface {}
2525 schema * schema.Schema
2626 toRemove * fieldpath.Set
27- shallow bool
27+ deep bool
2828}
2929
30- func removeItemsWithSchema (val value.Value , toRemove * fieldpath.Set , schema * schema.Schema , typeRef schema.TypeRef , shallow bool ) value.Value {
30+ func removeItemsWithSchema (val value.Value , toRemove * fieldpath.Set , schema * schema.Schema , typeRef schema.TypeRef , deep bool ) value.Value {
3131 w := & removingWalker {
3232 value : val ,
3333 schema : schema ,
3434 toRemove : toRemove ,
35- shallow : shallow ,
35+ deep : deep ,
3636 }
3737 resolveSchema (schema , typeRef , val , w )
3838 return value .NewValueInterface (w .out )
@@ -61,7 +61,7 @@ func (w *removingWalker) doList(t *schema.List) (errs ValidationErrors) {
6161 continue
6262 }
6363 if subset := w .toRemove .WithPrefix (pe ); ! subset .Empty () {
64- item = removeItemsWithSchema (item , subset , w .schema , t .ElementType , w .shallow )
64+ item = removeItemsWithSchema (item , subset , w .schema , t .ElementType , w .deep )
6565 }
6666 newItems = append (newItems , item .Unstructured ())
6767 }
@@ -89,7 +89,7 @@ func (w *removingWalker) doMap(t *schema.Map) ValidationErrors {
8989 pe := fieldpath.PathElement {FieldName : & k }
9090 path , _ := fieldpath .MakePath (pe )
9191
92- if w .shallow {
92+ if w .deep {
9393 if w .toRemove .Has (path ) {
9494 return true
9595 }
@@ -104,7 +104,7 @@ func (w *removingWalker) doMap(t *schema.Map) ValidationErrors {
104104 }
105105 }
106106 if subset := w .toRemove .WithPrefix (pe ); ! subset .Empty () {
107- val = removeItemsWithSchema (val , subset , w .schema , fieldType , w .shallow )
107+ val = removeItemsWithSchema (val , subset , w .schema , fieldType , w .deep )
108108 }
109109 newMap [k ] = val .Unstructured ()
110110 return true
0 commit comments