m-lab / etl

M-Lab ingestion pipeline
Apache License 2.0
22 stars 7 forks source link

fix most staticcheck warnings #989

Closed gfr10598 closed 2 years ago

gfr10598 commented 3 years ago

This PR fixes most of the warnings issued by the staticcheck tool. There are a few warnings left, primarily for unused err values.

Testing: Successful build + unit test coverage should be adequate, since these are expected to be strict refactorings and dead code deletions. Test coverage stats should be checked to ensure modified lines are actually covered by unit tests.


This change is Reviewable

coveralls commented 3 years ago

Pull Request Test Coverage Report for Build 6422


Changes Missing Coverage Covered Lines Changed/Added Lines %
cmd/etl_worker/etl_worker.go 19 20 95.0%
cmd/generate_schema_docs/main.go 0 1 0.0%
etl/globals.go 2 3 66.67%
parser/annotation.go 0 1 0.0%
storage/rowwriter.go 4 5 80.0%
schema/pt_schema.go 0 2 0.0%
web100/tcpkis.go 0 2 0.0%
parser/ss.go 0 3 0.0%
schema/web100.go 0 3 0.0%
parser/pt.go 6 14 42.86%
<!-- Total: 33 72 45.83% -->
Files with Coverage Reduction New Missed Lines %
parser/pt.go 1 75.33%
schema/web100.go 1 0%
active/poller.go 3 67.86%
<!-- Total: 5 -->
Totals Coverage Status
Change from base Build 6411: 0.2%
Covered Lines: 3468
Relevant Lines: 5532

💛 - Coveralls
stephen-soltesz commented 2 years ago

Closing this PR to clean up old PRs - the work to normalize the ETL codebases with standard Go static checks can be tracked in https://github.com/m-lab/etl/issues/1081