Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
sters committed Aug 29, 2022
1 parent 7c24773 commit e3b6a55
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 40 deletions.
53 changes: 15 additions & 38 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,46 +9,23 @@ linters-settings:
check-shadowing: true

linters:
enable:
- deadcode
- errcheck
- errorlint
- exportloopref
- forcetypeassert
- goconst
- gocritic
- godot
- gofmt
- gofumpt
- goimports
enable-all: true
disable:
- wsl
- exhaustivestruct
- exhaustruct
- exhaustive
- godox
- funlen
- gomnd
- gosec
- gosimple
- govet
- ifshort
- ineffassign
- misspell
- noctx
- prealloc
- revive
- rowserrcheck
- sqlclosecheck
- staticcheck
- structcheck
- typecheck
- unconvert
- unparam
- unused
- varcheck
- wastedassign
- gocognit
- cyclop

issues:
exclude-rules:
# Exclude shadow checking on the variable named err
- text: "shadow: declaration of \"err\""
linters:
- govet
# Exclude magic number detection
- text: "mnd: Magic number"
linters:
- gomnd
linters: ["govet"]
- text: "use of `fmt.Print"
linters: ["forbidigo"]
- text: "is too short for the scope of its usage"
linters: ["varnamelen"]
6 changes: 4 additions & 2 deletions cmd/yaml-diff/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package main

import (
"fmt"
"io/ioutil"
"io"
"log"
"os"

Expand Down Expand Up @@ -34,12 +34,14 @@ func load(f string) string {
defer func() { _ = file.Close() }()
if err != nil {
log.Printf("%+v, %s", err, f)

return ""
}

b, err := ioutil.ReadAll(file)
b, err := io.ReadAll(file)
if err != nil {
log.Printf("%+v, %s", err, f)

return ""
}

Expand Down
1 change: 1 addition & 0 deletions yamldiff/diff.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ func Do(list1 RawYamlList, list2 RawYamlList) Diffs {
return d
}
}

return nil
},
func(diffs []*Diff) *Diff {
Expand Down
1 change: 1 addition & 0 deletions yamldiff/yaml.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,6 @@ func newRawYaml(raw interface{}) *RawYaml {

func randInt() int64 {
n, _ := rand.Int(rand.Reader, big.NewInt(math.MaxInt64))

return n.Int64()
}

0 comments on commit e3b6a55

Please sign in to comment.