Skip to content

Commit

Permalink
Add golangci config
Browse files Browse the repository at this point in the history
  • Loading branch information
deanishe committed Oct 19, 2019
1 parent 2fe734b commit 7920b69
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
27 changes: 27 additions & 0 deletions .golangci.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
[run]
deadline = "5m"

[linters]
disable-all = true
enable = [
"deadcode",
"goconst",
"gofmt",
"gosimple",
"goimports",
"ineffassign",
"scopelint",
"staticcheck",
"stylecheck",
"unconvert",
"unused",
]

[linter-settings]
[linter-settings.errcheck]
check-blank = true
check-type-assertions = true

[issues]
max-same-issues = 50
max-issues-per-linter = 50
2 changes: 1 addition & 1 deletion scan.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ func (sm *ScanManager) dueScanners() []string {

if age, err := wf.Cache.Age(cacheKey); err == nil {
if fi, err := os.Stat(configFile); err == nil {
if time.Now().Sub(fi.ModTime()) < age {
if time.Since(fi.ModTime()) < age {
log.Printf("[scan] config file has changed")
force = true
}
Expand Down

0 comments on commit 7920b69

Please sign in to comment.