@@ -281,7 +281,7 @@ func (annotate *annotateModel) annotateModel(options map[string]string) error {
281281
282282 // Traverse and annotate the messages defined in this API.
283283 for _ , m := range model .Messages {
284- annotate .annotateMessage (m , annotate . imports )
284+ annotate .annotateMessage (m )
285285 }
286286
287287 for _ , s := range model .Services {
@@ -436,9 +436,9 @@ func (annotate *annotateModel) annotateService(s *api.Service) {
436436 s .Codec = ann
437437}
438438
439- func (annotate * annotateModel ) annotateMessage (m * api.Message , imports map [ string ] bool ) {
439+ func (annotate * annotateModel ) annotateMessage (m * api.Message ) {
440440 // Add the import for the common JSON helpers.
441- imports [commonHelpersImport ] = true
441+ annotate . imports [commonHelpersImport ] = true
442442
443443 for _ , f := range m .Fields {
444444 annotate .annotateField (f )
@@ -450,7 +450,7 @@ func (annotate *annotateModel) annotateMessage(m *api.Message, imports map[strin
450450 annotate .annotateEnum (e )
451451 }
452452 for _ , m := range m .Messages {
453- annotate .annotateMessage (m , imports )
453+ annotate .annotateMessage (m )
454454 }
455455
456456 constructorBody := ";"
@@ -510,12 +510,11 @@ func createToStringLines(message *api.Message) []string {
510510
511511func (annotate * annotateModel ) annotateMethod (method * api.Method ) {
512512 // Ignore imports added from the input and output messages.
513- tempImports := map [string ]bool {}
514513 if method .InputType .Codec == nil {
515- annotate .annotateMessage (method .InputType , tempImports )
514+ annotate .annotateMessage (method .InputType )
516515 }
517516 if method .OutputType .Codec == nil {
518- annotate .annotateMessage (method .OutputType , tempImports )
517+ annotate .annotateMessage (method .OutputType )
519518 }
520519
521520 pathInfoAnnotation := & pathInfoAnnotation {
0 commit comments