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

optimize(hz):router file insertPointPattern add compatibility with spaces format #1077

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmd/hz/generator/package_tpl.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ var (
idlClientName = "idl_client.go" // client of service for quick call

insertPointNew = "//INSERT_POINT: DO NOT DELETE THIS LINE!"
insertPointPatternNew = `//INSERT_POINT\: DO NOT DELETE THIS LINE\!`
insertPointPatternNew = `//\s?INSERT_POINT\: DO NOT DELETE THIS LINE\!`
)

var templateNameSet = map[string]string{
Expand Down
2 changes: 1 addition & 1 deletion cmd/hz/generator/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ func (pkgGen *HttpPackageGenerator) updateRegister(pkg, rDir, pkgName string) er

subIndexReg := regRegisterV3.FindSubmatchIndex(file)
FGYFFFF marked this conversation as resolved.
Show resolved Hide resolved
if len(subIndexReg) != 2 || subIndexReg[0] < 1 {
return fmt.Errorf("wrong format %s: insert-point '%s' not found", string(file), insertPointPatternNew)
return fmt.Errorf("wrong format %s: insert-point '%s' not found", string(file), insertPointNew)
}

bufReg := bytes.NewBuffer(nil)
Expand Down
Loading