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

investigate and fix staticcheck issues #3519

Open
dmitris opened this issue Feb 20, 2024 · 1 comment
Open

investigate and fix staticcheck issues #3519

dmitris opened this issue Feb 20, 2024 · 1 comment
Assignees
Labels

Comments

@dmitris
Copy link
Contributor

dmitris commented Feb 20, 2024

The output of $ golangci-lint run --disable-all -E staticcheck ./...:
https://gist.github.com/dmitris/9e0dcaeba2c55ada6071dc844a7f7df0

It would be great to go through those issues, decide which ones should be addressed and fix them.

@bretg bretg added the PBS-Go label Feb 20, 2024
dmitris added a commit to dmitris/prebid-server that referenced this issue Apr 10, 2024
dmitris added a commit to dmitris/prebid-server that referenced this issue Apr 17, 2024
dmitris added a commit to dmitris/prebid-server that referenced this issue Apr 22, 2024
dmitris added a commit to dmitris/prebid-server that referenced this issue Apr 25, 2024
@dmitris
Copy link
Contributor Author

dmitris commented Jun 19, 2024

current output (commit 4dc4005):

$ golangci-lint run --disable-all -E staticcheck ./... |& tee /tmp/out
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()
	            ^
adapters/rubicon/rubicon.go:387:4: SA4006: this value of `err` is never used (staticcheck)
			videoCopy.Ext, err = json.Marshal(&videoExt)
			^
adapters/rubicon/rubicon.go:450: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{
	^
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)
	                                              ^
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)
		                 ^

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Ready for Dev
Development

No branches or pull requests

3 participants