Skip to content

Commit

Permalink
bump golangci-lint to v1.45
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremmfr committed Oct 24, 2022
1 parent 7d7a8aa commit f0db826
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ jobs:
- name: golangci-lint
uses: golangci/[email protected]
with:
version: v1.46
version: v1.50
args: -c .golangci.yml -v
5 changes: 5 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ linters:
- scopelint # deprecated 1.39
- golint # deprecated 1.41
- exhaustivestruct # deprecated 1.46
# ifshort # deprecated 1.48 but no replacement
- nosnakecase # deprecated 1.48.1
- structcheck # deprecated 1.49.0
- deadcode # deprecated 1.49.0
- varcheck # deprecated 1.49.0
- wsl
- gochecknoglobals
- gomnd
Expand Down
5 changes: 2 additions & 3 deletions jdecode_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,19 @@ func TestDecodePassword(t *testing.T) {
}
}

// nolint: gosec
// TestDecodeBadEncoded try decode encrypted secret but with missing or extra character.
func TestDecodeBadEncoded(t *testing.T) {
// remove last character
if passwordDecoded, err := junosdecode.Decode(junWordCoded[:len(junWordCoded)-1]); err == nil {
t.Errorf("missing character in junWordCoded not detected, passwordDecoded: %s", passwordDecoded)
}
// add last character
if passwordDecoded, err := junosdecode.Decode(junWordCoded + string(rune(rand.Intn(26)))); err == nil {
if passwordDecoded, err := junosdecode.Decode(junWordCoded + string(rune(rand.Intn(26)))); err == nil { //nolint: gosec
t.Errorf("extra character in junWordCoded not detected, passwordDecoded: %s", passwordDecoded)
}
// add two last characters
if passwordDecoded, err := junosdecode.Decode(
junWordCoded + string(rune(rand.Intn(26))) + string(rune(rand.Intn(26)))); err == nil {
junWordCoded + string(rune(rand.Intn(26))) + string(rune(rand.Intn(26)))); err == nil { //nolint: gosec
t.Errorf("extra characters in junWordCoded not detected, passwordDecoded: %s", passwordDecoded)
}
}

0 comments on commit f0db826

Please sign in to comment.