File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed
Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -570,10 +570,11 @@ func EmitExtractionFailedForProjects(path []string) {
570570}
571571
572572func EmitPrivateRegistryUsed (writer DiagnosticsWriter , configs []string ) {
573- lines := []string {}
573+ n := len (configs )
574+ lines := [n ]string {}
574575
575576 for i := range configs {
576- lines = append ( lines , fmt .Sprintf ("* %s" , configs [i ]) )
577+ lines [ i ] = fmt .Sprintf ("* %s" , configs [i ])
577578 }
578579
579580 emitDiagnosticTo (
@@ -582,7 +583,7 @@ func EmitPrivateRegistryUsed(writer DiagnosticsWriter, configs []string) {
582583 "Go extraction used private package registries" ,
583584 fmt .Sprintf (
584585 "Go was extracted using the following private package registr%s:\n \n %s\n " ,
585- plural (len ( lines ) , "y" , "ies" ),
586+ plural (n , "y" , "ies" ),
586587 strings .Join (lines , "\n " )),
587588 severityNote ,
588589 fullVisibility ,
Original file line number Diff line number Diff line change @@ -112,7 +112,7 @@ func getEnvVars() []string {
112112 if err != nil {
113113 slog .Error ("Unable to parse proxy configurations" , slog .String ("error" , err .Error ()))
114114 } else {
115- activeConfigs := []RegistryConfig {}
115+ activeConfigs := make ( []RegistryConfig {}, 0 , len ( val ))
116116
117117 // We only care about private registry configurations that are relevant to Go and
118118 // filter others out at this point.
You can’t perform that action at this time.
0 commit comments