ci: add reviewdog (#1096)

This commit is contained in:
Kevin Wan
2021-09-29 13:09:20 +08:00
committed by GitHub
parent 80e3407be1
commit 65905b914d
23 changed files with 46 additions and 86 deletions

View File

@@ -28,11 +28,7 @@ func JavaCommand(c *cli.Context) error {
return err
}
packetName := api.Service.Name
if strings.HasSuffix(packetName, "-api") {
packetName = packetName[:len(packetName)-4]
}
packetName := strings.TrimSuffix(api.Service.Name, "-api")
logx.Must(util.MkdirIfNotExist(dir))
logx.Must(genPacket(dir, packetName, api))
logx.Must(genComponents(dir, packetName, api))

View File

@@ -204,10 +204,7 @@ func processUri(route spec.Route) string {
}
}
}
result := builder.String()
if strings.HasSuffix(result, " + \"") {
result = result[:len(result)-4]
}
result := strings.TrimSuffix(builder.String(), " + \"")
if strings.HasPrefix(result, "/") {
result = strings.TrimPrefix(result, "/")
result = "\"" + result