| 149 | } |
| 150 | |
| 151 | func (cmp *Comparer) BuildCache() (errors []error) { |
| 152 | for index := range cmp.NaturalIndexes() { |
| 153 | pathError, _ := cmp.GetPathErrors(index) |
| 154 | if len(pathError) > 0 { |
| 155 | for _, path := range pathError { |
| 156 | errors = append(errors, fmt.Errorf("path error at layer index %s: %s", index, path)) |
| 157 | } |
| 158 | } |
| 159 | _, err := cmp.GetTree(index) |
| 160 | if err != nil { |
| 161 | errors = append(errors, err) |
| 162 | return errors |
| 163 | } |
| 164 | } |
| 165 | |
| 166 | for index := range cmp.AggregatedIndexes() { |
| 167 | _, err := cmp.GetTree(index) |
| 168 | if err != nil { |
| 169 | errors = append(errors, err) |
| 170 | return errors |
| 171 | } |
| 172 | } |
| 173 | return errors |
| 174 | } |