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
2
2
3
3
import (
4
4
"fmt"
5
+ "sort"
5
6
"strings"
6
7
7
8
"github.com/golang/glog"
@@ -187,12 +188,18 @@ func (r *Registry) LoadFromPlugin(gen *protogen.Plugin) error {
187
188
}
188
189
189
190
func (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 )
192
194
}
195
+ sort .Strings (filePaths )
193
196
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 {
196
203
continue
197
204
}
198
205
file := r .files [filePath ]
You can’t perform that action at this time.
0 commit comments