Skip to content

Commit 191bfc4

Browse files
authored
Merge pull request #61 from pohly/linting
update linter config and fix issues
2 parents fe8a3cc + b34ac77 commit 191bfc4

File tree

6 files changed

+28
-23
lines changed

6 files changed

+28
-23
lines changed

.github/workflows/lint.yaml

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -21,22 +21,3 @@ jobs:
2121
args:
2222
-v
2323
--max-same-issues 10
24-
--disable-all
25-
--exclude-use-default=false
26-
-E asciicheck
27-
-E deadcode
28-
-E errcheck
29-
-E forcetypeassert
30-
-E gocritic
31-
-E gofmt
32-
-E goimports
33-
-E gosimple
34-
-E govet
35-
-E ineffassign
36-
-E misspell
37-
-E revive
38-
-E staticcheck
39-
-E structcheck
40-
-E typecheck
41-
-E unused
42-
-E varcheck

.golangci.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
issues:
2+
exclude-use-default: false
3+
4+
linters:
5+
disable-all: true
6+
enable:
7+
- asciicheck
8+
- errcheck
9+
- forcetypeassert
10+
- gocritic
11+
- gofmt
12+
- goimports
13+
- gosimple
14+
- govet
15+
- ineffassign
16+
- misspell
17+
- revive
18+
- staticcheck
19+
- typecheck
20+
- unused

example/main.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17+
// This example shows how to instantiate a zap logger and what output
18+
// looks like.
1719
package main
1820

1921
import (

internal/types/objectref.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17+
// Package types holds a copy of the ObjectRef type from klog for
18+
// use in the example.
1719
package types
1820

1921
import (

zapr.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@ limitations under the License.
3131
// Package zapr defines an implementation of the github.com/go-logr/logr
3232
// interfaces built on top of Zap (go.uber.org/zap).
3333
//
34-
// Usage
34+
// # Usage
3535
//
3636
// A new logr.Logger can be constructed from an existing zap.Logger using
3737
// the NewLogger function:
3838
//
39-
// log := zapr.NewLogger(someZapLogger)
39+
// log := zapr.NewLogger(someZapLogger)
4040
//
41-
// Implementation Details
41+
// # Implementation Details
4242
//
4343
// For the most part, concepts in Zap correspond directly with those in
4444
// logr.

zapr_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ func fixedTimeEncoder(_ time.Time, enc zapcore.PrimitiveArrayEncoder) {
4545
// discard is a replacement for io.Discard, needed for Go 1.14.
4646
type discard struct{}
4747

48-
func (d discard) Write(p []byte) (n int, err error) { return n, nil }
48+
func (d discard) Write(_ []byte) (int, error) { return 0, nil }
4949

5050
type marshaler struct {
5151
msg string

0 commit comments

Comments
 (0)