(gen *protogen.Plugin)
| 245 | } |
| 246 | |
| 247 | func (r *Registry) load(gen *protogen.Plugin) error { |
| 248 | filePaths := make([]string, 0, len(gen.FilesByPath)) |
| 249 | for filePath := range gen.FilesByPath { |
| 250 | filePaths = append(filePaths, filePath) |
| 251 | } |
| 252 | sort.Strings(filePaths) |
| 253 | |
| 254 | for _, filePath := range filePaths { |
| 255 | r.loadFile(filePath, gen.FilesByPath[filePath]) |
| 256 | } |
| 257 | |
| 258 | for _, filePath := range filePaths { |
| 259 | if !gen.FilesByPath[filePath].Generate { |
| 260 | continue |
| 261 | } |
| 262 | file := r.files[filePath] |
| 263 | if err := r.loadServices(file); err != nil { |
| 264 | return err |
| 265 | } |
| 266 | } |
| 267 | |
| 268 | return nil |
| 269 | } |
| 270 | |
| 271 | // loadFile loads messages, enumerations and fields from "file". |
| 272 | // It does not load services and methods in "file". You need to call |
no test coverage detected