File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed
Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ package descriptor
22
33import (
44 "fmt"
5+ "sort"
56 "strings"
67
78 "github.com/golang/glog"
@@ -187,12 +188,18 @@ func (r *Registry) LoadFromPlugin(gen *protogen.Plugin) error {
187188}
188189
189190func (r * Registry ) load (gen * protogen.Plugin ) error {
190- for filePath , f := range gen .FilesByPath {
191- r .loadFile (filePath , f )
191+ filePaths := make ([]string , 0 , len (gen .FilesByPath ))
192+ for filePath := range gen .FilesByPath {
193+ filePaths = append (filePaths , filePath )
192194 }
195+ sort .Strings (filePaths )
193196
194- for filePath , f := range gen .FilesByPath {
195- if ! f .Generate {
197+ for _ , filePath := range filePaths {
198+ r .loadFile (filePath , gen .FilesByPath [filePath ])
199+ }
200+
201+ for _ , filePath := range filePaths {
202+ if ! gen .FilesByPath [filePath ].Generate {
196203 continue
197204 }
198205 file := r .files [filePath ]
You can’t perform that action at this time.
0 commit comments