mirror of
https://github.com/caddyserver/caddy.git
synced 2025-03-23 21:54:51 +01:00
chore: Modernize a couple for loops
This commit is contained in:
parent
e276994174
commit
8dc76676fb
1 changed files with 2 additions and 2 deletions
|
@ -340,7 +340,7 @@ func (st ServerType) buildTLSApp(
|
||||||
combined = reflect.New(reflect.TypeOf(cl)).Elem()
|
combined = reflect.New(reflect.TypeOf(cl)).Elem()
|
||||||
}
|
}
|
||||||
clVal := reflect.ValueOf(cl)
|
clVal := reflect.ValueOf(cl)
|
||||||
for i := 0; i < clVal.Len(); i++ {
|
for i := range clVal.Len() {
|
||||||
combined = reflect.Append(combined, clVal.Index(i))
|
combined = reflect.Append(combined, clVal.Index(i))
|
||||||
}
|
}
|
||||||
loadersByName[name] = combined.Interface().(caddytls.CertificateLoader)
|
loadersByName[name] = combined.Interface().(caddytls.CertificateLoader)
|
||||||
|
@ -469,7 +469,7 @@ func (st ServerType) buildTLSApp(
|
||||||
globalPreferredChains := options["preferred_chains"]
|
globalPreferredChains := options["preferred_chains"]
|
||||||
hasGlobalACMEDefaults := globalEmail != nil || globalACMECA != nil || globalACMECARoot != nil || globalACMEDNS != nil || globalACMEEAB != nil || globalPreferredChains != nil
|
hasGlobalACMEDefaults := globalEmail != nil || globalACMECA != nil || globalACMECARoot != nil || globalACMEDNS != nil || globalACMEEAB != nil || globalPreferredChains != nil
|
||||||
if hasGlobalACMEDefaults {
|
if hasGlobalACMEDefaults {
|
||||||
for i := 0; i < len(tlsApp.Automation.Policies); i++ {
|
for i := range tlsApp.Automation.Policies {
|
||||||
ap := tlsApp.Automation.Policies[i]
|
ap := tlsApp.Automation.Policies[i]
|
||||||
if len(ap.Issuers) == 0 && automationPolicyHasAllPublicNames(ap) {
|
if len(ap.Issuers) == 0 && automationPolicyHasAllPublicNames(ap) {
|
||||||
// for public names, create default issuers which will later be filled in with configured global defaults
|
// for public names, create default issuers which will later be filled in with configured global defaults
|
||||||
|
|
Loading…
Add table
Reference in a new issue