type removingWalker … // removeItemsWithSchema will walk the given value and look for items from the toRemove set. // Depending on whether shouldExtract is set true or false, it will return a modified version // of the input value with either: // 1. only the items in the toRemove set (when shouldExtract is true) or // 2. the items from the toRemove set removed from the value (when shouldExtract is false). func removeItemsWithSchema(val value.Value, toRemove *fieldpath.Set, schema *schema.Schema, typeRef schema.TypeRef, shouldExtract bool) value.Value { … } func (w *removingWalker) doScalar(t *schema.Scalar) ValidationErrors { … } func (w *removingWalker) doList(t *schema.List) (errs ValidationErrors) { … } func (w *removingWalker) doMap(t *schema.Map) ValidationErrors { … }