Skip to content

Commit

Permalink
Merge pull request #61 from pohly/linting
Browse files Browse the repository at this point in the history
update linter config and fix issues
  • Loading branch information
pohly committed Oct 26, 2023
2 parents fe8a3cc + b34ac77 commit 191bfc4
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 23 deletions.
19 changes: 0 additions & 19 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,3 @@ jobs:
args:
-v
--max-same-issues 10
--disable-all
--exclude-use-default=false
-E asciicheck
-E deadcode
-E errcheck
-E forcetypeassert
-E gocritic
-E gofmt
-E goimports
-E gosimple
-E govet
-E ineffassign
-E misspell
-E revive
-E staticcheck
-E structcheck
-E typecheck
-E unused
-E varcheck
20 changes: 20 additions & 0 deletions .golangci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
issues:
exclude-use-default: false

linters:
disable-all: true
enable:
- asciicheck
- errcheck
- forcetypeassert
- gocritic
- gofmt
- goimports
- gosimple
- govet
- ineffassign
- misspell
- revive
- staticcheck
- typecheck
- unused
2 changes: 2 additions & 0 deletions example/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

// This example shows how to instantiate a zap logger and what output
// looks like.
package main

import (
Expand Down
2 changes: 2 additions & 0 deletions internal/types/objectref.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

// Package types holds a copy of the ObjectRef type from klog for
// use in the example.
package types

import (
Expand Down
6 changes: 3 additions & 3 deletions zapr.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ limitations under the License.
// Package zapr defines an implementation of the github.com/go-logr/logr
// interfaces built on top of Zap (go.uber.org/zap).
//
// Usage
// # Usage
//
// A new logr.Logger can be constructed from an existing zap.Logger using
// the NewLogger function:
//
// log := zapr.NewLogger(someZapLogger)
// log := zapr.NewLogger(someZapLogger)
//
// Implementation Details
// # Implementation Details
//
// For the most part, concepts in Zap correspond directly with those in
// logr.
Expand Down
2 changes: 1 addition & 1 deletion zapr_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func fixedTimeEncoder(_ time.Time, enc zapcore.PrimitiveArrayEncoder) {
// discard is a replacement for io.Discard, needed for Go 1.14.
type discard struct{}

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

type marshaler struct {
msg string
Expand Down

0 comments on commit 191bfc4

Please sign in to comment.