@marcel91200 / caddy Mirror · read-only / commits / 8dc76676
Fork 0

Fast and extensible multi-platform HTTP/1-2-3 web server with automatic HTTPS

Mirrored from https://github.com/Slazee/caddy.git

Synced Nov 12, 02:00 UTC

chore: Modernize a couple for loops

Matthew Holt committed Mar 19, 2025 at 09:53 UTC 8dc76676fb5156f971db49c50a5c509d1c93613b
1 file changed +2 -2
caddyconfig/httpcaddyfile/tlsapp.go
+2 -2
@@ -340,7 +340,7 @@ func (st ServerType) buildTLSApp(
340 combined = reflect.New(reflect.TypeOf(cl)).Elem()
341 }
342 clVal := reflect.ValueOf(cl)
343 - for i := 0; i < clVal.Len(); i++ {
343 + for i := range clVal.Len() {
344 combined = reflect.Append(combined, clVal.Index(i))
345 }
346 loadersByName[name] = combined.Interface().(caddytls.CertificateLoader)
@@ -469,7 +469,7 @@ func (st ServerType) buildTLSApp(
469 globalPreferredChains := options["preferred_chains"]
470 hasGlobalACMEDefaults := globalEmail != nil || globalACMECA != nil || globalACMECARoot != nil || globalACMEDNS != nil || globalACMEEAB != nil || globalPreferredChains != nil
471 if hasGlobalACMEDefaults {
472 - for i := 0; i < len(tlsApp.Automation.Policies); i++ {
472 + for i := range tlsApp.Automation.Policies {
473 ap := tlsApp.Automation.Policies[i]
474 if len(ap.Issuers) == 0 && automationPolicyHasAllPublicNames(ap) {
475 // for public names, create default issuers which will later be filled in with configured global defaults