Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

chore: fix some warnings (#6960)

Danny Xu2bfd22d0a835
diff --git a/backend/api/v1/common.go b/backend/api/v1/common.go
index 2e066be6f3..856dd4c21b 100644
--- a/backend/api/v1/common.go
+++ b/backend/api/v1/common.go
@@ -75,7 +75,7 @@ var (
)
func isNumber(v string) (int, bool) {
- n, err := strconv.ParseInt(v, 10, 64)
+ n, err := strconv.Atoi(v)
if err == nil {
return int(n), true
}
diff --git a/backend/api/v1/project_service.go b/backend/api/v1/project_service.go
index 1a095ea89d..80b93cad98 100644
--- a/backend/api/v1/project_service.go
+++ b/backend/api/v1/project_service.go
@@ -830,7 +830,7 @@ func (s *ProjectService) createProjectGitOpsInfo(ctx context.Context, request *v
return nil, status.Errorf(codes.FailedPrecondition, setupExternalURLError)
}
- vcsID, err := strconv.ParseInt(request.ProjectGitopsInfo.VcsUid, 10, 64)
+ vcsID, err := strconv.Atoi(request.ProjectGitopsInfo.VcsUid)
if err != nil {
return nil, status.Errorf(codes.InvalidArgument, "invalid vcs id: %s", request.ProjectGitopsInfo.VcsUid)
}
diff --git a/backend/server/webhook.go b/backend/server/webhook.go
index 57db7acc87..15d458ac8b 100644
--- a/backend/server/webhook.go
+++ b/backend/server/webhook.go
@@ -420,7 +420,7 @@ func (s *Server) registerWebhookRoutes(g *echo.Group) {
// of the xml file
// 2. If we can find it, then we will extract the sql from the mapper xml
// 3. match the environments in the configuration xml, look for the sql-review policy in the environment and apply it.
- var isMybatisMapperXMLRegex = regexp.MustCompile(`(?i)http(s)?://mybatis.org/dtd/mybatis-3-mapper.dtd`)
+ var isMybatisMapperXMLRegex = regexp.MustCompile(`(?i)http(s)?://mybatis\.org/dtd/mybatis-3-mapper\.dtd`)
mybatisMapperXMLFiles := make(map[string]string)
var commitID string
@@ -2027,7 +2027,7 @@ func (s *Server) buildMybatisMapperXMLFileData(ctx context.Context, repoInfo *re
var mybatisMapperXMLFileData []*mybatisMapperXMLFileDatum
// isMybatisConfigXMLRegex is the regex to match the mybatis configuration XML file, if it can match the file content,
// we regard the file as the mybatis configuration XML file.
- var isMybatisConfigXMLRegex = regexp.MustCompile(`(?i)http(s)?://mybatis.org/dtd/mybatis-3-config.dtd`)
+ var isMybatisConfigXMLRegex = regexp.MustCompile(`(?i)http(s)?://mybatis\.org/dtd/mybatis-3-config\.dtd`)
// configPathCache is the cache of the mybatis configuration XML file directory,
// the key is the mybatis mapper XML file ls-tree syntax directory, and value is the mybatis configuration XML file ls-tree syntax path.
configPathCache := make(map[string]string)