From e7f1c757591124033ed1f93211f1d2ca223e333c Mon Sep 17 00:00:00 2001 From: Luis Cruz Date: Tue, 9 Apr 2024 19:52:04 -0400 Subject: [PATCH] Upgrade deps (#51) - Upgrade deps - Fix lint & lint command --- Makefile | 2 +- go.mod | 4 ++-- go.sum | 4 ++++ service/site_test.go | 20 ++++++++++---------- 4 files changed, 17 insertions(+), 13 deletions(-) diff --git a/Makefile b/Makefile index e92f230..64ff7c5 100755 --- a/Makefile +++ b/Makefile @@ -9,7 +9,7 @@ analyze: lint vet test ## Run lint, vet, and test .PHONY: lint lint: ## Lint the code - @! revive -config .revive.toml ./... | grep -v vendor + @revive -config .revive.toml ./... | grep -v vendor .PHONY: test test: unit-test ## Run the test suite(s). diff --git a/go.mod b/go.mod index deba5c5..ed6fffc 100644 --- a/go.mod +++ b/go.mod @@ -8,8 +8,8 @@ require github.com/sprak3000/go-client v1.1.0 require ( github.com/sprak3000/go-glitch v1.1.0 - github.com/sprak3000/go-whatsup-client v1.1.0 - github.com/stretchr/testify v1.8.4 + github.com/sprak3000/go-whatsup-client v1.2.0 + github.com/stretchr/testify v1.9.0 ) require ( diff --git a/go.sum b/go.sum index 84241de..3a78be4 100644 --- a/go.sum +++ b/go.sum @@ -10,8 +10,12 @@ github.com/sprak3000/go-glitch v1.1.0 h1:6haWWwI/X12nT/1metfmuIJ55glM8n8Y9MAjOBg github.com/sprak3000/go-glitch v1.1.0/go.mod h1:YiS3Au3XFzjkfGFzEWCR/j7WZq5+fhgZotchT4yYblY= github.com/sprak3000/go-whatsup-client v1.1.0 h1:FsjLJcF4IPyCld6PvRiAVxoCSZgvDsuJo1AbobOzBnQ= github.com/sprak3000/go-whatsup-client v1.1.0/go.mod h1:r8h5Herq50rVll/Tn8kLioCd3eu/4VpgkvLS8AXUo1g= +github.com/sprak3000/go-whatsup-client v1.2.0 h1:wUw5Qpnk5Jq0sgrixjd5XbM/hxrZsO2xqPBJ9Y73keI= +github.com/sprak3000/go-whatsup-client v1.2.0/go.mod h1:r8h5Herq50rVll/Tn8kLioCd3eu/4VpgkvLS8AXUo1g= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= +github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= diff --git a/service/site_test.go b/service/site_test.go index 2fe27d4..51554dc 100644 --- a/service/site_test.go +++ b/service/site_test.go @@ -37,7 +37,7 @@ func TestUnit_Site_UnmarshalJSON(t *testing.T) { URL: *codeClimateURL, Type: statuspageio.ServiceType, }, - validate: func(t *testing.T, expectedSite, actualSite Site, expectedErr, actualErr error) { + validate: func(t *testing.T, expectedSite, actualSite Site, _, actualErr error) { require.NoError(t, actualErr) require.Equal(t, expectedSite, actualSite) }, @@ -45,7 +45,7 @@ func TestUnit_Site_UnmarshalJSON(t *testing.T) { "exceptional path- parse URL error": { siteJSON: []byte(`{"url":":","type":"statuspage.io"}`), expectedErr: errors.New(`parse ":": missing protocol scheme`), - validate: func(t *testing.T, expectedSite, actualSite Site, expectedErr, actualErr error) { + validate: func(t *testing.T, _, _ Site, expectedErr, actualErr error) { require.Error(t, actualErr) require.Equal(t, expectedErr.Error(), actualErr.Error()) }, @@ -150,7 +150,7 @@ func TestUnit_GetOverview(t *testing.T) { Type: slack.ServiceType, }, }, - setupStatusPageClient: func(t *testing.T, expectedErr glitch.DataError) whatsup.StatusPageClient { + setupStatusPageClient: func(_ *testing.T, _ glitch.DataError) whatsup.StatusPageClient { c := clientmock.NewMockStatusPageClient(ctrl) c.EXPECT().StatuspageIoService("CodeClimate", codeClimateURL.String()).Times(1).Return(codeClimateMinorOutageResp, nil) c.EXPECT().StatuspageIoService("CircleCI", circleciURL.String()).Times(1).Return(circleciMajorOutageResp, nil) @@ -188,7 +188,7 @@ func TestUnit_GetOverview(t *testing.T) { Type: statuspageio.ServiceType, }, }, - setupStatusPageClient: func(t *testing.T, expectedErr glitch.DataError) whatsup.StatusPageClient { + setupStatusPageClient: func(_ *testing.T, _ glitch.DataError) whatsup.StatusPageClient { c := clientmock.NewMockStatusPageClient(ctrl) c.EXPECT().StatuspageIoService("CodeClimate", codeClimateURL.String()).Times(1).Return(codeClimateNoOutageResp, nil) c.EXPECT().StatuspageIoService("CircleCI", circleciURL.String()).Times(1).Return(circleciMinorOutageResp, nil) @@ -222,7 +222,7 @@ func TestUnit_GetOverview(t *testing.T) { Type: statuspageio.ServiceType, }, }, - setupStatusPageClient: func(t *testing.T, expectedErr glitch.DataError) whatsup.StatusPageClient { + setupStatusPageClient: func(_ *testing.T, _ glitch.DataError) whatsup.StatusPageClient { c := clientmock.NewMockStatusPageClient(ctrl) c.EXPECT().StatuspageIoService("CodeClimate", codeClimateURL.String()).AnyTimes().Return(codeClimateNoOutageResp, nil) c.EXPECT().StatuspageIoService("CircleCI", circleciURL.String()).AnyTimes().Return(nil, glitch.NewDataError(nil, whatsupstatus.ErrorUnableToMakeClientRequest, "test err")) @@ -261,7 +261,7 @@ func TestUnit_GetOverview(t *testing.T) { Type: "not-a-finger", }, }, - setupStatusPageClient: func(t *testing.T, expectedErr glitch.DataError) whatsup.StatusPageClient { + setupStatusPageClient: func(_ *testing.T, _ glitch.DataError) whatsup.StatusPageClient { c := clientmock.NewMockStatusPageClient(ctrl) return c }, @@ -306,7 +306,7 @@ func TestUnit_LoadSites(t *testing.T) { Type: statuspageio.ServiceType, }, }, - validate: func(t *testing.T, expectedSites, actualSites Sites, expectedErr, actualErr glitch.DataError) { + validate: func(t *testing.T, expectedSites, actualSites Sites, _, actualErr glitch.DataError) { require.NoError(t, actualErr) require.Equal(t, expectedSites, actualSites) }, @@ -315,7 +315,7 @@ func TestUnit_LoadSites(t *testing.T) { reader: fileReaderWithoutFilename{}, writer: fileWriterSuccess{}, expectedSites: Sites{}, - validate: func(t *testing.T, expectedSites, actualSites Sites, expectedErr, actualErr glitch.DataError) { + validate: func(t *testing.T, expectedSites, actualSites Sites, _, actualErr glitch.DataError) { require.NoError(t, actualErr) require.Equal(t, expectedSites, actualSites) }, @@ -324,7 +324,7 @@ func TestUnit_LoadSites(t *testing.T) { reader: fileReaderWithoutFilename{}, writer: fileWriterErr{}, expectedErr: glitch.NewDataError(errors.New("write err"), ErrorUnableToWriteDefaultConfiguration, "unable to create default What's Up configuration"), - validate: func(t *testing.T, expectedSites, actualSites Sites, expectedErr, actualErr glitch.DataError) { + validate: func(t *testing.T, _, _ Sites, expectedErr, actualErr glitch.DataError) { require.Error(t, actualErr) require.Equal(t, expectedErr.Code(), actualErr.Code()) }, @@ -333,7 +333,7 @@ func TestUnit_LoadSites(t *testing.T) { reader: fileReaderReturnsInvalidContents{}, filename: "test-config.json", expectedErr: glitch.NewDataError(nil, ErrorUnableToParseConfiguration, "error parsing What's Up configuration"), - validate: func(t *testing.T, expectedSites, actualSites Sites, expectedErr, actualErr glitch.DataError) { + validate: func(t *testing.T, _, _ Sites, expectedErr, actualErr glitch.DataError) { require.Error(t, actualErr) require.Equal(t, expectedErr.Code(), actualErr.Code()) },