Skip to content

Commit

Permalink
Merge pull request TarsCloud#249 from defool/fix_tars2go_module
Browse files Browse the repository at this point in the history
Support parent directory of outdir in tars2go
  • Loading branch information
hooligan520 authored Oct 22, 2020
2 parents 755d659 78979cf commit a5349e6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tars/tools/tars2go/gen_go.go
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 323,8 @@ func (gen *GenGo) genStructImport(module string, protoName string, mImports map[
// TarsTest/MyApp
var modulePath string
if gen.module != "" {
modulePath = fmt.Sprintf("%s/%s%s%s", gen.module, gen.prefix, jcePath, moduleStr)
mf := filepath.Clean(filepath.Join(gen.module, gen.prefix))
modulePath = fmt.Sprintf("%s/%s%s", mf, jcePath, moduleStr)
} else {
modulePath = fmt.Sprintf("%s%s", jcePath, moduleStr)
}
Expand Down Expand Up @@ -402,7 403,8 @@ func (gen *GenGo) genIFImport(module string, protoName string) {
// TarsTest/MyApp
var modulePath string
if gen.module != "" {
modulePath = fmt.Sprintf("%s/%s%s%s", gen.module, gen.prefix, jcePath, moduleStr)
mf := filepath.Clean(filepath.Join(gen.module, gen.prefix))
modulePath = fmt.Sprintf("%s/%s%s", mf, jcePath, moduleStr)
} else {
modulePath = fmt.Sprintf("%s%s", jcePath, moduleStr)
}
Expand Down

0 comments on commit a5349e6

Please sign in to comment.