Skip to content

Commit

Permalink
Merge pull request #4 from dbsystel/develop
Browse files Browse the repository at this point in the history
Solving the issue with golangci-lint
  • Loading branch information
Tanemahuta authored Jun 8, 2021
2 parents 9a2bd4b + b905d67 commit 72b40ed
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 6 deletions.
4 changes: 4 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,10 @@ issues:
linters:
- lll
- funlen
- path: testing
linters:
- gomnd
- revive
run:
timeout: 3m
# skip generated files
Expand Down
2 changes: 1 addition & 1 deletion testing/admission_test/v1.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func (v *V1AdmissionReview) MustMarshal() []byte {
return json_test.MarshalJSONOrPanic((*v1.AdmissionReview)(v))
}

//nolint:dupl
// nolint:dupl
func NewV1Review(obj, oldObj testing.Reviewable) func() *V1AdmissionReview {
rawExt, oldRawExt := rawExts(obj, oldObj)
return func() *V1AdmissionReview {
Expand Down
2 changes: 1 addition & 1 deletion testing/admission_test/v1beta1.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func (v *V1Beta1AdmissionReview) MustMarshal() []byte {
return json_test.MarshalJSONOrPanic((*v1beta1.AdmissionReview)(v))
}

//nolint:dupl
// nolint:dupl
func NewV1Beta1Review(obj, oldObj testing.Reviewable) func() *V1Beta1AdmissionReview {
rawExt, oldRawExt := rawExts(obj, oldObj)
return func() *V1Beta1AdmissionReview {
Expand Down
4 changes: 2 additions & 2 deletions testing/httpext_test/fixture.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package httpext_test
import (
"github.com/dbsystel/kewl/pkg/httpext"
"github.com/dbsystel/kewl/pkg/panicutils"
"github.com/go-logr/logr/testing"
"github.com/go-logr/logr"
)

// Fixture is a fixture for testing httpext.Server
Expand Down Expand Up @@ -34,7 +34,7 @@ func newFixture(enableHTTPS bool) *Fixture {
config.TLSConfig.PublicKeyFile = pemFilePair.PublicKeyPath()
config.TLSConfig.PrivateKeyFile = pemFilePair.PrivateKeyPath()
}
server, err := httpext.NewServer(testing.NullLogger{}, config)
server, err := httpext.NewServer(logr.DiscardLogger{}, config)
panicutils.PanicIfError(err)
return &Fixture{Sut: server, Test: &TestFacade{ServeMux: server.ServeMux}}
}
Expand Down
4 changes: 2 additions & 2 deletions testing/webhook_test/fixture.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"github.com/dbsystel/kewl/pkg/panicutils"
"github.com/dbsystel/kewl/pkg/webhook"
"github.com/dbsystel/kewl/testing/httpext_test"
"github.com/go-logr/logr/testing"
"github.com/go-logr/logr"
)

type Fixture struct {
Expand All @@ -13,7 +13,7 @@ type Fixture struct {
}

func NewFixture() *Fixture {
server, err := webhook.NewServer(&testing.NullLogger{}, httpext_test.TestConfig())
server, err := webhook.NewServer(&logr.DiscardLogger{}, httpext_test.TestConfig())
panicutils.PanicIfError(err)
return &Fixture{Sut: server, Test: &ReviewFacade{&httpext_test.TestFacade{ServeMux: server.ServeMux}}}
}

0 comments on commit 72b40ed

Please sign in to comment.