-
-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use {{.PackageName}} in templates to represent the package in project. #3457
base: master
Are you sure you want to change the base?
Conversation
tools/goctl/api/gogen/genhandlers.go
Outdated
@@ -3,6 +3,7 @@ package gogen | |||
import ( | |||
_ "embed" | |||
"fmt" | |||
"github.com/zeromicro/go-zero/tools/goctl/pkg/golang" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import two-stage
tools/goctl/api/gogen/genlogic.go
Outdated
@@ -3,6 +3,7 @@ package gogen | |||
import ( | |||
_ "embed" | |||
"fmt" | |||
"github.com/zeromicro/go-zero/tools/goctl/pkg/golang" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import two-stage
@@ -19,6 +20,7 @@ const defaultLogicPackage = "logic" | |||
var handlerTemplate string | |||
|
|||
type handlerInfo struct { | |||
PackageName string | |||
PkgName string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the difference between PackageName
and PkgName
?
可以在api模版 handler.tpl 中使用 {{.PackageName}} 代表当前项目的包名
可以在api模版 logic.tpl 中使用 {{.packageName}} 代表当前项目的包名