File tree Expand file tree Collapse file tree 1 file changed +8
-15
lines changed
Expand file tree Collapse file tree 1 file changed +8
-15
lines changed Original file line number Diff line number Diff line change @@ -211,22 +211,15 @@ func (m mergeableBatcher) AddToFile(file *File) error {
211211 })
212212
213213 // Inherit validation options from file if batch doesn't have them
214- if file .GetValidation () != nil {
215- // Use a local interface to access SetValidation
216- type validatable interface {
217- SetValidation (* ValidateOpts )
218- }
214+ if opts := file .GetValidation (); opts != nil {
215+ m .batcher .SetValidation (opts )
219216
220- if v , ok := m .batcher .(validatable ); ok {
221- v .SetValidation (file .GetValidation ())
222-
223- // Also set validation on all entries
224- for _ , entry := range m .batcher .GetEntries () {
225- entry .SetValidation (file .GetValidation ())
226- }
227- for _ , entry := range m .batcher .GetADVEntries () {
228- entry .SetValidation (file .GetValidation ())
229- }
217+ // Also set validation on all entries
218+ for _ , entry := range m .batcher .GetEntries () {
219+ entry .SetValidation (opts )
220+ }
221+ for _ , entry := range m .batcher .GetADVEntries () {
222+ entry .SetValidation (opts )
230223 }
231224 }
232225
You can’t perform that action at this time.
0 commit comments