mirror of
https://github.com/coredns/coredns.git
synced 2025-10-27 08:14:18 -04:00
lint: enable intrange linter (#7331)
Enable intrange linter to enforce modern Go range syntax over traditional for loops, by converting: for i := 0; i < n; i++ to: for i := range n Adding type conversions where needed for compatibility with existing uint64 parameters. Signed-off-by: Ville Vesilehto <ville@vesilehto.fi>
This commit is contained in:
@@ -211,7 +211,7 @@ func (h *CloudDNS) updateZones(ctx context.Context) error {
|
||||
// Collect errors (if any). This will also sync on all zones updates
|
||||
// completion.
|
||||
var errs []string
|
||||
for i := 0; i < len(h.zones); i++ {
|
||||
for range len(h.zones) {
|
||||
err := <-errc
|
||||
if err != nil {
|
||||
errs = append(errs, err.Error())
|
||||
|
||||
@@ -43,7 +43,7 @@ func setup(c *caddy.Controller) error {
|
||||
|
||||
args := c.RemainingArgs()
|
||||
|
||||
for i := 0; i < len(args); i++ {
|
||||
for i := range args {
|
||||
parts := strings.SplitN(args[i], ":", 3)
|
||||
if len(parts) != 3 {
|
||||
return plugin.Error("clouddns", c.Errf("invalid zone %q", args[i]))
|
||||
|
||||
Reference in New Issue
Block a user