imageToPathToExternalPath returns a map from path to external path for all ImageFiles in the Image. We do not transmit external path information over the wire to plugins, so we need to keep track of this on the client side to properly construct bufanalysis.FileAnnotations when we get back check.Ann
(image bufimage.Image)
| 42 | // of this on the client side to properly construct bufanalysis.FileAnnotations when we get back |
| 43 | // check.Annotations. This is used in annotationToFileAnnotation. |
| 44 | func imageToPathToExternalPath(image bufimage.Image) map[string]string { |
| 45 | imageFiles := image.Files() |
| 46 | pathToExternalPath := make(map[string]string, len(imageFiles)) |
| 47 | for _, imageFile := range imageFiles { |
| 48 | // We know that Images do not have overlapping paths. |
| 49 | pathToExternalPath[imageFile.Path()] = imageFile.ExternalPath() |
| 50 | } |
| 51 | return pathToExternalPath |
| 52 | } |
no test coverage detected
searching dependent graphs…