Skip to content

Commit

Permalink
Fix static analysis bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
DomBlack committed Feb 2, 2024
1 parent 6eb7f7b commit 2f4f22d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 1 addition & 0 deletions cli/daemon/run/runtime_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ func (g *RuntimeEnvGenerator) runtimeConfigForServices(services []*meta.Service,
for _, svc := range services {
// Configure all the SQL databases for the service
for _, sqlDB := range g.dbsBySvc[svc.Name] {
// nosemgrep
server, db, err := g.InfraManager.SQLConfig(sqlDB)
if err != nil {
return "", errors.Wrapf(err, "failed to generate SQL config for database %s for service %s", db.DatabaseName, svc.Name)
Expand Down
4 changes: 1 addition & 3 deletions pkg/errinsrc/srcrender.go
Original file line number Diff line number Diff line change
Expand Up @@ -338,9 +338,7 @@ func renderErrorText(builder *strings.Builder, startCol int, numDigitsInLineNumb

// It's possible the start column references generated code; in that case reset
// the column information as a fallback to prevent panics below.
if startCol > len(srcLine) {
startCol = 0
} else {
if startCol <= len(srcLine) {
// Compute the whitespace prefix we need on each line
// (Note this will render tabs as tabs still if they are present)
prefixWhitespace = strings.Repeat(" ", calcNumberCharactersForColumnNumber(srcLine, startCol-1))
Expand Down

0 comments on commit 2f4f22d

Please sign in to comment.