Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
code health: fix all places highlighted by linter
Changed the warning's suppression in check.yaml. The suppression of the rule errcheck may be removed after adding errors check in all methods calling encodeXxx inside. See details below. Suppressed the highlighting lacks of error's check in all methods, having encodeXxx inside. For now those methods are not able to return any error due to internal implementation of writer interface (see smallbuf.go). For future, if the implementation of the writer will be changed, and there will be a need to check errors, we must think about how to say to compiler that the error check is 'unlikely' for keeping performance (If there will be any affect on it). Fixed the use of time package API in all places with calls of time.Now().Sub(). Now time package propose the explicit time.Until(). Replaced all calls of Errorf() with Fatalf() in tests, where it is needed. That change prevents nil dereferences below in the code and stops the test execution, where it is expected in tests. Suppressed the highlighting of all unused constants and functions with //nolint comment. Fixed the calling of Fatalf() from non-testing goroutine in queue tests. It is not a valid way to stop test from another goroutine. Fixed the gofmt-highlighted places in test_helpers/pool_helper.go and connection_pool/const.go. Added instructions to CONTRIBUTING.md how to run CI-linter locally. Closes #142 Closes #150
- Loading branch information