Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update linter config and fix issues #61

Merged
merged 1 commit into from
Oct 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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