|
|
@ -3,6 +3,7 @@ package generator
|
|
|
|
import (
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"fmt"
|
|
|
|
"path/filepath"
|
|
|
|
"path/filepath"
|
|
|
|
|
|
|
|
"sort"
|
|
|
|
"strings"
|
|
|
|
"strings"
|
|
|
|
|
|
|
|
|
|
|
|
"github.com/emicklei/proto"
|
|
|
|
"github.com/emicklei/proto"
|
|
|
@ -95,9 +96,11 @@ func (g *DefaultGenerator) GenCall(ctx DirContext, proto parser.Proto, cfg *conf
|
|
|
|
alias.AddStr(fmt.Sprintf("%s = %s", parser.CamelCase(msgName), fmt.Sprintf("%s.%s", proto.PbPackage, parser.CamelCase(msgName))))
|
|
|
|
alias.AddStr(fmt.Sprintf("%s = %s", parser.CamelCase(msgName), fmt.Sprintf("%s.%s", proto.PbPackage, parser.CamelCase(msgName))))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
aliasKeys := alias.KeysStr()
|
|
|
|
|
|
|
|
sort.Strings(aliasKeys)
|
|
|
|
err = util.With("shared").GoFmt(true).Parse(text).SaveTo(map[string]interface{}{
|
|
|
|
err = util.With("shared").GoFmt(true).Parse(text).SaveTo(map[string]interface{}{
|
|
|
|
"name": callFilename,
|
|
|
|
"name": callFilename,
|
|
|
|
"alias": strings.Join(alias.KeysStr(), util.NL),
|
|
|
|
"alias": strings.Join(aliasKeys, util.NL),
|
|
|
|
"head": head,
|
|
|
|
"head": head,
|
|
|
|
"filePackage": dir.Base,
|
|
|
|
"filePackage": dir.Base,
|
|
|
|
"package": fmt.Sprintf(`"%s"`, ctx.GetPb().Package),
|
|
|
|
"package": fmt.Sprintf(`"%s"`, ctx.GetPb().Package),
|
|
|
|