Fix the problem of package name for generated kt code. (#3082)

Co-authored-by: 李春华 <lichunhua@threesoft.cn>
This commit is contained in:
lchjczw 2023-04-08 22:46:34 +08:00 committed by GitHub
parent 98c9b5928a
commit 189e9bd9da
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View File

@ -1,4 +1,4 @@
package {{with .Info}}{{.Desc}}{{end}}
package {{.Pkg}}
import com.google.gson.Gson

View File

@ -82,5 +82,9 @@ func genApi(dir, pkg string, api *spec.ApiSpec) error {
if e != nil {
return e
}
return t.Execute(file, api)
type data struct {
*spec.ApiSpec
Pkg string
}
return t.Execute(file, data{api, pkg})
}