Skip to content
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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

xybingbing
Copy link
Contributor

可以在api模版 handler.tpl 中使用 {{.PackageName}} 代表当前项目的包名
可以在api模版 logic.tpl 中使用 {{.packageName}} 代表当前项目的包名

@MarkJoyMa MarkJoyMa requested a review from kesonan August 1, 2023 06:32
@@ -3,6 +3,7 @@ package gogen
import (
_ "embed"
"fmt"
"github.com/zeromicro/go-zero/tools/goctl/pkg/golang"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

import two-stage

@@ -3,6 +3,7 @@ package gogen
import (
_ "embed"
"fmt"
"github.com/zeromicro/go-zero/tools/goctl/pkg/golang"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

import two-stage

@codecov
Copy link

codecov bot commented Oct 23, 2023

Codecov Report

Merging #3457 (4f6c67d) into master (00db97f) will increase coverage by 0.03%.
The diff coverage is n/a.

see 2 files with indirect coverage changes

@@ -19,6 +20,7 @@ const defaultLogicPackage = "logic"
var handlerTemplate string

type handlerInfo struct {
PackageName string
PkgName string
Copy link
Contributor

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?

@kevwan kevwan added do-not-merge/hold Indicates that a PR should not merge because of known issues or need more discussion. area/goctl Categorizes issue or PR as related to goctl. labels Oct 23, 2023
@kevwan kevwan changed the title 模版中可以使用 {{.PackageName}} 代表当前项目的包名 Use {{.PackageName}} in templates to represent the package in project. Oct 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/goctl Categorizes issue or PR as related to goctl. do-not-merge/hold Indicates that a PR should not merge because of known issues or need more discussion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants