MCPcopy
hub / github.com/wagoodman/dive / BuildCache

Method BuildCache

dive/filetree/comparer.go:151–174  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

149}
150
151func (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}

Callers 2

runFunction · 0.95
initializeTestViewModelFunction · 0.95

Calls 4

NaturalIndexesMethod · 0.95
GetPathErrorsMethod · 0.95
GetTreeMethod · 0.95
AggregatedIndexesMethod · 0.95

Tested by 1

initializeTestViewModelFunction · 0.76