func clearOverlayFields(ctx *visitorContext, val reflect.Value, typ reflect.Type) (retainAncestors bool) {
	for i := 0; i < typ.NumField(); i++ {
		structField := typ.Field(i)

		// Skip non-exportable and empty fields
		v := val.Field(i)
		if !v.CanInterface() || isZero(v) {
			continue
		}

		// No need to recurse further down; just erase the field
		if isOverlayField(structField) {
			v.Set(reflect.Zero(v.Type()))
			continue
		}

		_ = visitField(ctx, v.Interface())
		retainAncestors = true
	}
	return retainAncestors
}
// clearOverlayFields is an implementation of structVisitor. It recursively
// visits all fields in the val struct and sets the ones that are tagged as
// overlay-only to the zero value for their particular type.
clearOverlayFields is an implementation of structVisitor. It recursively
visits all fields in the val struct and sets the ones that are tagged as
overlay-only to the zero value for their particular type.
// clearOverlayFields is an implementation of structVisitor . It recursively // visits all fields in the val struct and sets the ones that are tagged as // overlay - only to the zero value for their particular type .
func clearOverlayFields(ctx *visitorContext, val reflect.Value, typ reflect.Type) (retainAncestors bool) {
	for i := 0; i < typ.NumField(); i++ {
		structField := typ.Field(i)
		v := val.Field(i)
		if !v.CanInterface() || isZero(v) {
			continue
		}
		if isOverlayField(structField) {
			v.Set(reflect.Zero(v.Type()))
			continue
		}
		_ = visitField(ctx, v.Interface())
		retainAncestors = true
	}
	return retainAncestors
}
func clearOverlayFields ( ctx * visitorContext , val reflect . Value , typ reflect . Type ) ( retainAncestors bool ) { for i := 0 ; i < typ . NumField ( ) ; i ++ { structField := typ . Field ( i ) v := val . Field ( i ) if ! v . CanInterface ( ) || isZero ( v ) { continue } if isOverlayField ( structField ) { v . Set ( reflect . Zero ( v . Type ( ) ) ) continue } _ = visitField ( ctx , v . Interface ( ) ) retainAncestors = true } return retainAncestors }
clearOverlayFields is an implementation of structVisitor.
clearOverlayFields is an implementation of structVisitor .
// Skip non-exportable and empty fields // No need to recurse further down; just erase the field