Skip to content

Commit 82eda48

Browse files
committed
cli/connhelper/internal/syntax: fix linting issues
cli/connhelper/internal/syntax/parser.go:31:2: Duplicate words (the) found (dupword) // Note that it shares some features with Bash, due to the the shared ^ cli/connhelper/internal/syntax/quote.go:48:1: cyclomatic complexity 35 of func `Quote` is high (> 16) (gocyclo) func Quote(s string, lang LangVariant) (string, error) { ^ cli/connhelper/internal/syntax/quote.go:103:3: shadow: declaration of "offs" shadows declaration at line 56 (govet) offs := 0 ^ Signed-off-by: Sebastiaan van Stijn <[email protected]>
1 parent 52d2a9b commit 82eda48

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

cli/connhelper/internal/syntax/parser.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const (
2424

2525
// LangMirBSDKorn corresponds to the MirBSD Korn Shell, also known as
2626
// mksh, as described at http://www.mirbsd.org/htman/i386/man1/mksh.htm.
27-
// Note that it shares some features with Bash, due to the the shared
27+
// Note that it shares some features with Bash, due to the shared
2828
// ancestry that is ksh.
2929
//
3030
// We currently follow mksh version 59.

cli/connhelper/internal/syntax/quote.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ const (
4545
//
4646
// Some strings do not require any quoting and are returned unchanged.
4747
// Those strings can be directly surrounded in single quotes as well.
48+
//
49+
//nolint:gocyclo // ignore "cyclomatic complexity 35 of func `Quote` is high (> 16) (gocyclo)"
4850
func Quote(s string, lang LangVariant) (string, error) {
4951
if s == "" {
5052
// Special case; an empty string must always be quoted,
@@ -100,7 +102,7 @@ func Quote(s string, lang LangVariant) (string, error) {
100102
if nonPrintable {
101103
b.WriteString("$'")
102104
lastRequoteIfHex := false
103-
offs := 0
105+
offs = 0
104106
for rem := s; len(rem) > 0; {
105107
nextRequoteIfHex := false
106108
r, size := utf8.DecodeRuneInString(rem)

0 commit comments

Comments
 (0)