mirror of
https://github.com/github/codeql.git
synced 2026-02-11 20:51:06 +01:00
Apply suggestions from code review
Co-authored-by: Owen Mansel-Chan <62447351+owen-mc@users.noreply.github.com>
This commit is contained in:
@@ -570,10 +570,11 @@ func EmitExtractionFailedForProjects(path []string) {
|
||||
}
|
||||
|
||||
func EmitPrivateRegistryUsed(writer DiagnosticsWriter, configs []string) {
|
||||
lines := []string{}
|
||||
n := len(configs)
|
||||
lines := make([]string, n)
|
||||
|
||||
for i := range configs {
|
||||
lines = append(lines, fmt.Sprintf("* %s", configs[i]))
|
||||
lines[i] = fmt.Sprintf("* %s", configs[i])
|
||||
}
|
||||
|
||||
emitDiagnosticTo(
|
||||
@@ -582,7 +583,7 @@ func EmitPrivateRegistryUsed(writer DiagnosticsWriter, configs []string) {
|
||||
"Go extraction used private package registries",
|
||||
fmt.Sprintf(
|
||||
"Go was extracted using the following private package registr%s:\n\n%s\n",
|
||||
plural(len(lines), "y", "ies"),
|
||||
plural(n, "y", "ies"),
|
||||
strings.Join(lines, "\n")),
|
||||
severityNote,
|
||||
fullVisibility,
|
||||
|
||||
@@ -112,7 +112,7 @@ func getEnvVars() []string {
|
||||
if err != nil {
|
||||
slog.Error("Unable to parse proxy configurations", slog.String("error", err.Error()))
|
||||
} else {
|
||||
activeConfigs := []RegistryConfig{}
|
||||
activeConfigs := make([]RegistryConfig, 0, len(val))
|
||||
|
||||
// We only care about private registry configurations that are relevant to Go and
|
||||
// filter others out at this point.
|
||||
|
||||
Reference in New Issue
Block a user