From 2a0694d2fa577574b505c4635eb8a824eaf88ddc Mon Sep 17 00:00:00 2001 From: Shulhan Date: Thu, 23 Jan 2025 03:40:50 +0700 Subject: all: use for-range with numeric Go 1.22 now support for-range on numeric value. --- lib/sshconfig/parser.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'lib/sshconfig/parser.go') diff --git a/lib/sshconfig/parser.go b/lib/sshconfig/parser.go index 152b3fee..3c460a6f 100644 --- a/lib/sshconfig/parser.go +++ b/lib/sshconfig/parser.go @@ -1,6 +1,6 @@ -// Copyright 2020, Shulhan . All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. +// SPDX-FileCopyrightText: 2020 M. Shulhan +// +// SPDX-License-Identifier: BSD-3-Clause package sshconfig @@ -88,7 +88,7 @@ func (p *parser) load(dir, pattern string) (lines []string, err error) { dir = filepath.Dir(pattern) // Check and parse the Include directive in each lines. - for x := 0; x < len(rawLines); x++ { + for x := range len(rawLines) { if !isIncludeDirective(rawLines[x]) { lines = append(lines, rawLines[x]) continue @@ -200,7 +200,7 @@ func readLines(file string) (lines []string, err error) { } rawLines := bytes.Split(contents, []byte{'\n'}) - for x := 0; x < len(rawLines); x++ { + for x := range len(rawLines) { rawLines[x] = bytes.TrimSpace(rawLines[x]) if len(rawLines[x]) == 0 { continue -- cgit v1.3-5-g45d5