Skip to content

Commit

Permalink
Upgrade deps (#51)
Browse files Browse the repository at this point in the history
- Upgrade deps
- Fix lint & lint command
  • Loading branch information
sprak3000 authored Apr 9, 2024
1 parent c305b14 commit e7f1c75
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 13 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
4 changes: 4 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down
20 changes: 10 additions & 10 deletions service/site_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@ 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)
},
},
"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())
},
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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"))
Expand Down Expand Up @@ -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
},
Expand Down Expand Up @@ -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)
},
Expand All @@ -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)
},
Expand All @@ -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())
},
Expand All @@ -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())
},
Expand Down

0 comments on commit e7f1c75

Please sign in to comment.