-
Notifications
You must be signed in to change notification settings - Fork 739
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
fix golangci-lint issues #3679
fix golangci-lint issues #3679
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left some comments. Could you resolve the TODOs as well please?
AlexBVolcy the remaining TODOs removed in 4036d50. |
The output of the command adapters/rubicon/rubicon.go:393:4: SA4006: this value of `err` is never used (staticcheck)
videoCopy.Ext, err = json.Marshal(&videoExt)
^
adapters/rubicon/rubicon.go:456:4: SA4006: this value of `err` is never used (staticcheck)
siteCopy.Publisher.Ext, err = json.Marshal(&pubExt)
^
analytics/agma/sender_test.go:125:2: SA4006: this value of `err` is never used (staticcheck)
sender, err := createHttpSender(client, config.AgmaAnalyticsHttpEndpoint{
^
prebid_cache_client/client.go:121:2: SA4006: this value of `err` is never used (staticcheck)
responseBody, err := io.ReadAll(anResp.Body)
^
adapters/adgeneration/adgeneration_test.go:248:5: SA5011(related information): this check suggests that the pointer can be nil (staticcheck)
if bidderResponse == nil {
^
adapters/adgeneration/adgeneration_test.go:264:40: SA5011: possible nil pointer dereference (staticcheck)
assert.Equal(t, 1, len(bidderResponse.Bids))
^
adapters/adgeneration/adgeneration_test.go:265:45: SA5011: possible nil pointer dereference (staticcheck)
assert.Equal(t, expectedID, bidderResponse.Bids[0].Bid.ID)
^
adapters/adgeneration/adgeneration_test.go:266:48: SA5011: possible nil pointer dereference (staticcheck)
assert.Equal(t, expectedImpID, bidderResponse.Bids[0].Bid.ImpID)
^
adapters/adgeneration/adgeneration_test.go:267:46: SA5011: possible nil pointer dereference (staticcheck)
assert.Equal(t, expectedAdM, bidderResponse.Bids[0].Bid.AdM)
^
adapters/adgeneration/adgeneration_test.go:268:48: SA5011: possible nil pointer dereference (staticcheck)
assert.Equal(t, expectedPrice, bidderResponse.Bids[0].Bid.Price)
^
adapters/adgeneration/adgeneration_test.go:269:44: SA5011: possible nil pointer dereference (staticcheck)
assert.Equal(t, expectedW, bidderResponse.Bids[0].Bid.W)
^
adapters/adgeneration/adgeneration_test.go:270:44: SA5011: possible nil pointer dereference (staticcheck)
assert.Equal(t, expectedH, bidderResponse.Bids[0].Bid.H)
^
adapters/adgeneration/adgeneration_test.go:271:47: SA5011: possible nil pointer dereference (staticcheck)
assert.Equal(t, expectedCrID, bidderResponse.Bids[0].Bid.CrID)
^
adapters/adgeneration/adgeneration_test.go:272:49: SA5011: possible nil pointer dereference (staticcheck)
assert.Equal(t, extectedDealID, bidderResponse.Bids[0].Bid.DealID)
^
exchange/bidder_test.go:1069:58: SA5011: possible nil pointer dereference (staticcheck)
assert.Equal(t, tc.expectedBidsCount, uint(len(seatBid.Bids)), tc.description)
^
exchange/bidder_test.go:1068:20: SA5011(related information): this check suggests that the pointer can be nil (staticcheck)
assert.Falsef(t, seatBid == nil && tc.expectedBidsCount != 0, tc.description)
^
stored_requests/events/http/http.go:83:15: SA1015: using time.Tick leaks the underlying ticker, consider using it only in endless functions, tests and the main package, and use time.NewTicker here (staticcheck)
go e.refresh(time.Tick(refreshRate))
^
adapters/yandex/yandex.go:159:40: SA1019: yandexExt.ImpID is deprecated: in favor of `PlacementID` (staticcheck)
placementID.ImpID = strconv.Itoa(int(yandexExt.ImpID))
^
adapters/yandex/yandex.go:160:41: SA1019: yandexExt.PageID is deprecated: in favor of `PlacementID` (staticcheck)
placementID.PageID = strconv.Itoa(int(yandexExt.PageID))
^
server/ssl/ssl_test.go:15:14: SA1019: certPool.Subjects has been deprecated since Go 1.18: if s was returned by [SystemCertPool], Subjects will not include the system roots. (staticcheck)
subjects := certPool.Subjects()
^
server/ssl/ssl_test.go:25:13: SA1019: certPool.Subjects has been deprecated since Go 1.18: if s was returned by [SystemCertPool], Subjects will not include the system roots. (staticcheck)
subjects = certPool.Subjects()
^
server/ssl/ssl_test.go:40:14: SA1019: certPool.Subjects has been deprecated since Go 1.18: if s was returned by [SystemCertPool], Subjects will not include the system roots. (staticcheck)
subjects := certPool.Subjects()
^ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
PR is the continuation of work on #3525 and a follow-up on #3621. It fixes a number of the issues flagged by
golangci-lint run -D errcheck -D unused -D ineffassign --max-same-issues 0 ./...
though not yet all of them ("eating the elephant piece by piece" 😄 )