Skip to content

Commit 967388d

Browse files
committed
Updating the source linting
This change puts specific lint configuration into place and cleans up some source to follow lint rules. Signed-off-by: Matt Farina <[email protected]>
1 parent 8f93e11 commit 967388d

File tree

4 files changed

+38
-12
lines changed

4 files changed

+38
-12
lines changed

.golangci.yml

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
run:
2+
deadline: 2m
3+
4+
linters:
5+
disable-all: true
6+
enable:
7+
- misspell
8+
- govet
9+
- staticcheck
10+
- errcheck
11+
- unparam
12+
- ineffassign
13+
- nakedret
14+
- gocyclo
15+
- dupl
16+
- goimports
17+
- revive
18+
- gosec
19+
- gosimple
20+
- typecheck
21+
- unused
22+
23+
linters-settings:
24+
dupl:
25+
threshold: 600

impl/logrus/logrus_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ func TestStandardLogrus(t *testing.T) {
245245

246246
}
247247

248-
func TestLogrusInterface(t *testing.T) {
248+
func TestLogrusInterface(_ *testing.T) {
249249
lgr := NewStandard()
250250
testfunc(lgr)
251251
}

io/io.go

+10-9
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
// Package io provides a means of turning a log.Logger into an io.Writer for
22
// a chosen level. An example of this would be:
3-
// import(
4-
// "io"
5-
// "github.com/Masterminds/log-go"
6-
// logio "github.com/Masterminds/log-go/io"
7-
// )
83
//
9-
// func main() {
10-
// w := logio.NewCurrentWriter(log.InfoLevel)
11-
// io.WriteString(w, "foo")
12-
// }
4+
// import(
5+
// "io"
6+
// "github.com/Masterminds/log-go"
7+
// logio "github.com/Masterminds/log-go/io"
8+
// )
9+
//
10+
// func main() {
11+
// w := logio.NewCurrentWriter(log.InfoLevel)
12+
// io.WriteString(w, "foo")
13+
// }
1314
package io
1415

1516
import (

io/io_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ func TestCurrentIO(t *testing.T) {
6868
}
6969
buf.Reset()
7070

71-
// Testing a non-existant level
71+
// Testing a non-existent level
7272
defer func() {
7373
if r := recover(); r != nil {
7474
t.Log(r)
@@ -137,7 +137,7 @@ func TestIO(t *testing.T) {
137137
}
138138
buf.Reset()
139139

140-
// Testing a non-existant level
140+
// Testing a non-existent level
141141
defer func() {
142142
if r := recover(); r != nil {
143143
t.Log(r)

0 commit comments

Comments
 (0)