Skip to content

Commit 8dc7667

Browse files
committed
chore: Modernize a couple for loops
1 parent e276994 commit 8dc7667

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

caddyconfig/httpcaddyfile/tlsapp.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ func (st ServerType) buildTLSApp(
340340
combined = reflect.New(reflect.TypeOf(cl)).Elem()
341341
}
342342
clVal := reflect.ValueOf(cl)
343-
for i := 0; i < clVal.Len(); i++ {
343+
for i := range clVal.Len() {
344344
combined = reflect.Append(combined, clVal.Index(i))
345345
}
346346
loadersByName[name] = combined.Interface().(caddytls.CertificateLoader)
@@ -469,7 +469,7 @@ func (st ServerType) buildTLSApp(
469469
globalPreferredChains := options["preferred_chains"]
470470
hasGlobalACMEDefaults := globalEmail != nil || globalACMECA != nil || globalACMECARoot != nil || globalACMEDNS != nil || globalACMEEAB != nil || globalPreferredChains != nil
471471
if hasGlobalACMEDefaults {
472-
for i := 0; i < len(tlsApp.Automation.Policies); i++ {
472+
for i := range tlsApp.Automation.Policies {
473473
ap := tlsApp.Automation.Policies[i]
474474
if len(ap.Issuers) == 0 && automationPolicyHasAllPublicNames(ap) {
475475
// for public names, create default issuers which will later be filled in with configured global defaults

0 commit comments

Comments
 (0)