Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update code to fix almost all pre-existing lint errors (#2008)
* Cleanup linting errors around deadcode To be specific ineffassign, deadcode and unused errors Signed-off-by: Nathan Zender <github@nathanzender.com> * Replaced by keysFn and if the config defines it then it will distribute keys using hashing Signed-off-by: Nathan Zender <github@nathanzender.com> * Hold over from when readBatch as also the iterator Now that we have an iterator there is no need to also have a consumed bool on the underlying object. Signed-off-by: Nathan Zender <github@nathanzender.com> * Necessary to fix the false sharing problem Will never actually be used. Only necessary to pad out CPU cache lines. Signed-off-by: Nathan Zender <github@nathanzender.com> * Removing unused code Signed-off-by: Nathan Zender <github@nathanzender.com> * Cleanup all gosimple suggestions Signed-off-by: Nathan Zender <github@nathanzender.com> * Fixing all errcheck Attempted not to change any existing logic so if an error was ignored we will now either explicitly ignore it or in the case of a goroutine being called with a func that is ignoring the error we will just put a //noling:errcheck on that line. If it was in a test case we went ahead and did the extra assertion checks b/c its always good to know where something might have errored in your test cases. Signed-off-by: Nathan Zender <github@nathanzender.com> * Fix most staticcheck lint issues Signed-off-by: Nathan Zender <github@nathanzender.com> * Cleanup deprecated call to snappy.NewWriter Signed-off-by: Nathan Zender <github@nathanzender.com> * Remove rev from Makefile Signed-off-by: Nathan Zender <github@nathanzender.com> * Reorder imports Signed-off-by: Nathan Zender <github@nathanzender.com> * Ignoring this for now We have opened up issue cortexproject/cortex#2015 to address the deprecation of this type. Signed-off-by: Nathan Zender <github@nathanzender.com> * Explicitly ignoring this error The test is currently failing due to a data race. I believe it is due to this bug in golang. golang/go#30597 As far as this test cares it does not really matter that this happens so removing the need to check for NoError "fixes" it. Signed-off-by: Nathan Zender <github@nathanzender.com> * Require noerror since this is a test Signed-off-by: Nathan Zender <github@nathanzender.com> * Switch over to use require.NoError Signed-off-by: Nathan Zender <github@nathanzender.com> * Move func to test class since that is only place it was used Signed-off-by: Nathan Zender <github@nathanzender.com> * Log warning if save to cache errors Signed-off-by: Nathan Zender <github@nathanzender.com> * Condense a little Signed-off-by: Nathan Zender <github@nathanzender.com> * Use returned error instead of capturing it Signed-off-by: Nathan Zender <github@nathanzender.com> * Bringing back ctx and adding comment Signed-off-by: Nathan Zender <github@nathanzender.com> * Log error if changing ring state fails when Leaving Signed-off-by: Nathan Zender <github@nathanzender.com> * If context deadline exceeded return the error Signed-off-by: Nathan Zender <github@nathanzender.com> * Can't defer this otherwise we will have no data Signed-off-by: Nathan Zender <github@nathanzender.com> * Comment to make it clear why this nolint was added Signed-off-by: Nathan Zender <github@nathanzender.com> * Refactor method out Since Fixture is already in testutils and it is being used in both places pulled it out into a common helper method in the testutils package. Signed-off-by: Nathan Zender <github@nathanzender.com> * io.Copy added to global errcheck exclude Signed-off-by: Nathan Zender <github@nathanzender.com> * If error dont do anything else Signed-off-by: Nathan Zender <github@nathanzender.com> * Cleanup unused function Signed-off-by: Nathan Zender <github@nathanzender.com> * Adding tracer to global excludes Signed-off-by: Nathan Zender <github@nathanzender.com> * Cleanup post rebase Formatting and import issues that got missed when merging. Signed-off-by: Nathan Zender <github@nathanzender.com> * Ratelimiter returns resource exhausted error This is necessary so that when it is used with the backoff retry it will allow for the backoff to continue to work as expected. Signed-off-by: Nathan Zender <github@nathanzender.com>
- Loading branch information