trackFileInfo says to track the FileInfo to mark its associated Module as having .proto files if the FileInfo represents a .proto file, and to mark its path as having the associated Module's opaqueID.
(fileInfo FileInfo)
| 57 | // if the FileInfo represents a .proto file, and to mark its path as having the associated Module's |
| 58 | // opaqueID. |
| 59 | func (t *protoFileTracker) trackFileInfo(fileInfo FileInfo) { |
| 60 | if fileInfo.FileType() != FileTypeProto { |
| 61 | return |
| 62 | } |
| 63 | module := fileInfo.Module() |
| 64 | opaqueID := module.OpaqueID() |
| 65 | t.opaqueIDToProtoFileExists[opaqueID] = true |
| 66 | protoPathOpaqueIDMap, ok := t.protoPathToOpaqueIDMap[fileInfo.Path()] |
| 67 | if !ok { |
| 68 | protoPathOpaqueIDMap = make(map[string]struct{}) |
| 69 | t.protoPathToOpaqueIDMap[fileInfo.Path()] = protoPathOpaqueIDMap |
| 70 | } |
| 71 | protoPathOpaqueIDMap[opaqueID] = struct{}{} |
| 72 | t.opaqueIDToDescription[opaqueID] = module.Description() |
| 73 | } |
| 74 | |
| 75 | // validate validates. This should be called when all tracking is complete. |
| 76 | func (t *protoFileTracker) validate() error { |
no test coverage detected