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

升级到beego@v1.12.2,commentRouter出现unknown escape sequence报错 #4384

Closed
peerswu opened this issue Dec 22, 2020 · 1 comment · Fixed by #4385
Closed

升级到beego@v1.12.2,commentRouter出现unknown escape sequence报错 #4384

peerswu opened this issue Dec 22, 2020 · 1 comment · Fixed by #4385
Assignees

Comments

@peerswu
Copy link

peerswu commented Dec 22, 2020

升级从 beego@v1.12.1 升级到beego@v1.12.2,生成的commentsRouter的正则出现错误,编译时报错:"unknown escape sequence"。

beego@v1.12.3也同样存在这个问题

routers/commentsRouter_controllers_xxxxxxxxx.go:49:28: unknown escape sequence

 46     beego.GlobalControllerRouter["someDir:Controller"] = append(beego.GlobalControllerRouter["someDir:Controller"],
 47         beego.ControllerComments{
 48             Method: "SomeMethod",
 49             Router: "/:id(\d+)",
 50             AllowHTTPMethods: []string{"POST"},
 51             MethodParams: param.Make(),
 52             Filters: nil,
 53             Params: nil})

有可能是这个变更引起的

diff pkg/mod/github.com/astaxie/beego@v1.12.1/parser.go pkg/mod/github.com/astaxie/beego@v1.12.2/parser.go
503c503
<             ` + "Router: `" + c.Router + "`" + `,
---
>             ` + `Router: "` + c.Router + `"` + `,
@flycash
Copy link
Collaborator

flycash commented Dec 22, 2020

=。=只能说修了一个BUG又引入一个BUG,😭

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants