Is your feature request related to a problem? Please describe.
During the Go 1.25.5 upgrade (#1360), golangci-lint was upgraded from v1.x to v2.x. The new version has stricter default linters enabled (errcheck and staticcheck) that were not enforced before, resulting in 52 new lint errors:
- errcheck (36 issues): Unchecked error return values
- staticcheck (16 issues): Various static analysis suggestions
These linters are currently disabled to keep the Go version upgrade PR focused.
Describe the solution you'd like
Enable errcheck and staticcheck linters by removing them from the disable list in .golangci.yml and fixing all 52 issues across the codebase.
Files affected:
cmd/httpstub/powershellstub/powershellstub.go
cmd/httpstub/sshstub/sshstub.go
pkg/deviceshifu/deviceshifubase/deviceshifubase.go
pkg/deviceshifu/deviceshifuhttp/deviceshifuhttp.go
pkg/deviceshifu/deviceshifulwm2m/deviceshifulwm2m.go
pkg/deviceshifu/deviceshifumqtt/deviceshifumqtt.go
pkg/deviceshifu/deviceshifusocket/deviceshifusocket.go
pkg/deviceshifu/deviceshifutcp/deviceshifutcp.go
pkg/gateway/lwm2m/client/lwm2m.go
pkg/telemetryservice/sql/mysql/mysql.go
pkg/telemetryservice/sql/sqlserver/sqlserver.go
pkg/telemetryservice/sql/tdengine/tdengine.go
- Various test files
Describe alternatives you've considered
- Excluding specific paths (examples/, test files) - partially implemented
- Using nolint directives - too verbose
Additional context
Reference: .golangci.yml has a TODO comment pointing to this issue.
Is your feature request related to a problem? Please describe.
During the Go 1.25.5 upgrade (#1360), golangci-lint was upgraded from v1.x to v2.x. The new version has stricter default linters enabled (
errcheckandstaticcheck) that were not enforced before, resulting in 52 new lint errors:These linters are currently disabled to keep the Go version upgrade PR focused.
Describe the solution you'd like
Enable
errcheckandstaticchecklinters by removing them from the disable list in.golangci.ymland fixing all 52 issues across the codebase.Files affected:
cmd/httpstub/powershellstub/powershellstub.gocmd/httpstub/sshstub/sshstub.gopkg/deviceshifu/deviceshifubase/deviceshifubase.gopkg/deviceshifu/deviceshifuhttp/deviceshifuhttp.gopkg/deviceshifu/deviceshifulwm2m/deviceshifulwm2m.gopkg/deviceshifu/deviceshifumqtt/deviceshifumqtt.gopkg/deviceshifu/deviceshifusocket/deviceshifusocket.gopkg/deviceshifu/deviceshifutcp/deviceshifutcp.gopkg/gateway/lwm2m/client/lwm2m.gopkg/telemetryservice/sql/mysql/mysql.gopkg/telemetryservice/sql/sqlserver/sqlserver.gopkg/telemetryservice/sql/tdengine/tdengine.goDescribe alternatives you've considered
Additional context
Reference:
.golangci.ymlhas a TODO comment pointing to this issue.