lint: enable prealloc (#7493)

This commit is contained in:
Ville Vesilehto
2025-09-02 04:05:15 +03:00
committed by GitHub
parent 4d3061a9c4
commit 359632a2f4
5 changed files with 8 additions and 6 deletions

View File

@@ -30,7 +30,7 @@ func stripZone(host string) string {
// and in case of filename a resolv.conf like file is (assumed) and parsed and
// the nameservers found are returned.
func HostPortOrFile(s ...string) ([]string, error) {
var servers []string
var servers []string //nolint:prealloc // impossible to know the final length upfront
for _, h := range s {
trans, host := Transport(h)
if len(host) == 0 {