aboutsummaryrefslogtreecommitdiff
path: root/lib/sshconfig
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sshconfig')
-rw-r--r--lib/sshconfig/parser.go10
-rw-r--r--lib/sshconfig/section_match.go9
2 files changed, 10 insertions, 9 deletions
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 <ms@kilabit.info>. 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 <ms@kilabit.info>
+//
+// 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
diff --git a/lib/sshconfig/section_match.go b/lib/sshconfig/section_match.go
index 4d9c7523..5baefc4d 100644
--- a/lib/sshconfig/section_match.go
+++ b/lib/sshconfig/section_match.go
@@ -1,6 +1,6 @@
-// Copyright 2020, Shulhan <ms@kilabit.info>. 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 <ms@kilabit.info>
+//
+// SPDX-License-Identifier: BSD-3-Clause
package sshconfig
@@ -38,7 +38,8 @@ func newSectionMatch(cfg *Config, rawPattern string) (match *Section, err error)
isNegate bool
)
- for x := 0; x < len(args); x++ {
+ var x int
+ for ; x < len(args); x++ {
token := strings.ToLower(args[x])
if x+1 < len(args) {
arg = args[x+1]