mirror of https://github.com/harness/drone.git
MISC: Fix go lint issues
parent
3c83ecb0df
commit
00cc64029a
|
@ -135,6 +135,7 @@ func (s *CodeCommentView) UpdateAll(ctx context.Context, codeComments []*types.C
|
||||||
|
|
||||||
db := dbtx.GetAccessor(ctx, s.db)
|
db := dbtx.GetAccessor(ctx, s.db)
|
||||||
|
|
||||||
|
//nolint:sqlclosecheck
|
||||||
stmt, err := db.PrepareNamedContext(ctx, sqlQuery)
|
stmt, err := db.PrepareNamedContext(ctx, sqlQuery)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return database.ProcessSQLErrorf(err, "Failed to prepare update statement for update code comments")
|
return database.ProcessSQLErrorf(err, "Failed to prepare update statement for update code comments")
|
||||||
|
|
|
@ -33,6 +33,7 @@ import (
|
||||||
var _ store.ConnectorStore = (*connectorStore)(nil)
|
var _ store.ConnectorStore = (*connectorStore)(nil)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
//nolint:goconst
|
||||||
connectorQueryBase = `
|
connectorQueryBase = `
|
||||||
SELECT` + connectorColumns + `
|
SELECT` + connectorColumns + `
|
||||||
FROM connectors`
|
FROM connectors`
|
||||||
|
|
|
@ -127,6 +127,7 @@ const (
|
||||||
|
|
||||||
// Find returns an execution given an execution ID.
|
// Find returns an execution given an execution ID.
|
||||||
func (s *executionStore) Find(ctx context.Context, id int64) (*types.Execution, error) {
|
func (s *executionStore) Find(ctx context.Context, id int64) (*types.Execution, error) {
|
||||||
|
//nolint:goconst
|
||||||
const findQueryStmt = `
|
const findQueryStmt = `
|
||||||
SELECT` + executionColumns + `
|
SELECT` + executionColumns + `
|
||||||
FROM executions
|
FROM executions
|
||||||
|
|
|
@ -72,6 +72,7 @@ const principalCommonColumns = `
|
||||||
const principalColumns = principalCommonColumns + `
|
const principalColumns = principalCommonColumns + `
|
||||||
,principal_type`
|
,principal_type`
|
||||||
|
|
||||||
|
//nolint:goconst
|
||||||
const principalSelectBase = `
|
const principalSelectBase = `
|
||||||
SELECT` + principalColumns + `
|
SELECT` + principalColumns + `
|
||||||
FROM principals`
|
FROM principals`
|
||||||
|
|
|
@ -115,6 +115,7 @@ func createReferenceWalkPatternsFromQuery(basePath string, query string) []strin
|
||||||
}
|
}
|
||||||
|
|
||||||
// suffix only match (refs/tags/**/*QUERY)
|
// suffix only match (refs/tags/**/*QUERY)
|
||||||
|
//nolint:goconst
|
||||||
return []string{basePath + "**/*" + query}
|
return []string{basePath + "**/*" + query}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -81,9 +81,8 @@ func (r *SharedRepo) Clone(ctx context.Context, branchName string) error {
|
||||||
}
|
}
|
||||||
} else if matched, _ = regexp.MatchString(".* repository .* does not exist.*", stderr); matched {
|
} else if matched, _ = regexp.MatchString(".* repository .* does not exist.*", stderr); matched {
|
||||||
return fmt.Errorf("%s %w", r.repoUID, types.ErrNotFound)
|
return fmt.Errorf("%s %w", r.repoUID, types.ErrNotFound)
|
||||||
} else {
|
|
||||||
return fmt.Errorf("Clone: %w %s", err, stderr)
|
|
||||||
}
|
}
|
||||||
|
return fmt.Errorf("Clone: %w %s", err, stderr)
|
||||||
}
|
}
|
||||||
gitRepo, err := git.OpenRepository(ctx, r.tmpPath)
|
gitRepo, err := git.OpenRepository(ctx, r.tmpPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in New Issue