Fix linter messages

This commit is contained in:
Lennart Kats 2025-01-13 11:02:21 +01:00
parent 3b63fb20d4
commit 9098320c63
No known key found for this signature in database
GPG Key ID: 1EB8B57673197023
2 changed files with 12 additions and 2 deletions

View File

@ -159,9 +159,9 @@ func validateProductionMode(ctx context.Context, b *bundle.Bundle, isPrincipalUs
// and neither is setting a principal. // and neither is setting a principal.
// We only show a warning for these cases since we didn't historically // We only show a warning for these cases since we didn't historically
// report an error for them. // report an error for them.
return diag.Recommendation("target with 'mode: production' should " + advice) return diag.Recommendationf("target with 'mode: production' should %s", advice)
} }
return diag.Errorf("target with 'mode: production' must " + advice) return diag.Errorf("target with 'mode: production' must %s", advice)
} }
return nil return nil
} }

View File

@ -86,6 +86,16 @@ func Infof(format string, args ...any) Diagnostics {
} }
} }
// Recommendationf creates a new recommendation diagnostic.
func Recommendationf(format string, args ...any) Diagnostics {
return []Diagnostic{
{
Severity: Recommendation,
Summary: fmt.Sprintf(format, args...),
},
}
}
// Diagnostics holds zero or more instances of [Diagnostic]. // Diagnostics holds zero or more instances of [Diagnostic].
type Diagnostics []Diagnostic type Diagnostics []Diagnostic