(base []any, toExclude []any)
| 797 | } |
| 798 | |
| 799 | func (f *FileField) excludeFiles(base []any, toExclude []any) []any { |
| 800 | result := make([]any, 0, len(base)) |
| 801 | |
| 802 | SUBTRACT_LOOP: |
| 803 | for _, fv := range base { |
| 804 | for _, exclude := range toExclude { |
| 805 | if f.getFileName(exclude) == f.getFileName(fv) { |
| 806 | continue SUBTRACT_LOOP // skip |
| 807 | } |
| 808 | } |
| 809 | |
| 810 | result = append(result, fv) |
| 811 | } |
| 812 | |
| 813 | return result |
| 814 | } |
| 815 | |
| 816 | func (f *FileField) getFileName(file any) string { |
| 817 | switch v := file.(type) { |
no test coverage detected