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

Update code to fix almost all pre-existing lint errors #2008

Merged
merged 31 commits into from Feb 24, 2020

Commits on Feb 24, 2020

  1. Cleanup linting errors around deadcode

    To be specific ineffassign, deadcode and unused errors
    
    Signed-off-by: Nathan Zender <github@nathanzender.com>
    zendern committed Feb 24, 2020
    Configuration menu
    Copy the full SHA
    0fc660e View commit details
    Browse the repository at this point in the history
  2. Replaced by keysFn and if the config defines it then it will distribute

    keys using hashing
    
    Signed-off-by: Nathan Zender <github@nathanzender.com>
    zendern committed Feb 24, 2020
    Configuration menu
    Copy the full SHA
    43520a2 View commit details
    Browse the repository at this point in the history
  3. 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>
    zendern committed Feb 24, 2020
    Configuration menu
    Copy the full SHA
    c3564f3 View commit details
    Browse the repository at this point in the history
  4. 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>
    zendern committed Feb 24, 2020
    Configuration menu
    Copy the full SHA
    782bd54 View commit details
    Browse the repository at this point in the history
  5. Removing unused code

    Signed-off-by: Nathan Zender <github@nathanzender.com>
    zendern committed Feb 24, 2020
    Configuration menu
    Copy the full SHA
    18d997f View commit details
    Browse the repository at this point in the history
  6. Cleanup all gosimple suggestions

    Signed-off-by: Nathan Zender <github@nathanzender.com>
    zendern committed Feb 24, 2020
    Configuration menu
    Copy the full SHA
    a60dcbb View commit details
    Browse the repository at this point in the history
  7. 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>
    zendern committed Feb 24, 2020
    Configuration menu
    Copy the full SHA
    2a3a929 View commit details
    Browse the repository at this point in the history
  8. Fix most staticcheck lint issues

    Signed-off-by: Nathan Zender <github@nathanzender.com>
    zendern committed Feb 24, 2020
    Configuration menu
    Copy the full SHA
    e77ea36 View commit details
    Browse the repository at this point in the history
  9. Cleanup deprecated call to snappy.NewWriter

    Signed-off-by: Nathan Zender <github@nathanzender.com>
    zendern committed Feb 24, 2020
    Configuration menu
    Copy the full SHA
    62b7efd View commit details
    Browse the repository at this point in the history
  10. Remove rev from Makefile

    Signed-off-by: Nathan Zender <github@nathanzender.com>
    zendern committed Feb 24, 2020
    Configuration menu
    Copy the full SHA
    ff69505 View commit details
    Browse the repository at this point in the history
  11. Reorder imports

    Signed-off-by: Nathan Zender <github@nathanzender.com>
    zendern committed Feb 24, 2020
    Configuration menu
    Copy the full SHA
    b666336 View commit details
    Browse the repository at this point in the history
  12. Ignoring this for now

    We have opened up issue
    cortexproject#2015 to address the
    deprecation of this type.
    
    Signed-off-by: Nathan Zender <github@nathanzender.com>
    zendern committed Feb 24, 2020
    Configuration menu
    Copy the full SHA
    fb4161c View commit details
    Browse the repository at this point in the history
  13. 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>
    zendern committed Feb 24, 2020
    Configuration menu
    Copy the full SHA
    ac3f181 View commit details
    Browse the repository at this point in the history
  14. Require noerror since this is a test

    Signed-off-by: Nathan Zender <github@nathanzender.com>
    zendern committed Feb 24, 2020
    Configuration menu
    Copy the full SHA
    e8413ff View commit details
    Browse the repository at this point in the history
  15. Switch over to use require.NoError

    Signed-off-by: Nathan Zender <github@nathanzender.com>
    zendern committed Feb 24, 2020
    Configuration menu
    Copy the full SHA
    9bfd5ef View commit details
    Browse the repository at this point in the history
  16. Move func to test class since that is only place it was used

    Signed-off-by: Nathan Zender <github@nathanzender.com>
    zendern committed Feb 24, 2020
    Configuration menu
    Copy the full SHA
    2dd3252 View commit details
    Browse the repository at this point in the history
  17. Log warning if save to cache errors

    Signed-off-by: Nathan Zender <github@nathanzender.com>
    zendern committed Feb 24, 2020
    Configuration menu
    Copy the full SHA
    4dfa046 View commit details
    Browse the repository at this point in the history
  18. Condense a little

    Signed-off-by: Nathan Zender <github@nathanzender.com>
    zendern committed Feb 24, 2020
    Configuration menu
    Copy the full SHA
    a8e0f53 View commit details
    Browse the repository at this point in the history
  19. Use returned error instead of capturing it

    Signed-off-by: Nathan Zender <github@nathanzender.com>
    zendern committed Feb 24, 2020
    Configuration menu
    Copy the full SHA
    0e81880 View commit details
    Browse the repository at this point in the history
  20. Bringing back ctx and adding comment

    Signed-off-by: Nathan Zender <github@nathanzender.com>
    zendern committed Feb 24, 2020
    Configuration menu
    Copy the full SHA
    4d3838f View commit details
    Browse the repository at this point in the history
  21. Log error if changing ring state fails when Leaving

    Signed-off-by: Nathan Zender <github@nathanzender.com>
    zendern committed Feb 24, 2020
    Configuration menu
    Copy the full SHA
    c8e8f56 View commit details
    Browse the repository at this point in the history
  22. If context deadline exceeded return the error

    Signed-off-by: Nathan Zender <github@nathanzender.com>
    zendern committed Feb 24, 2020
    Configuration menu
    Copy the full SHA
    aa2ecc6 View commit details
    Browse the repository at this point in the history
  23. Can't defer this otherwise we will have no data

    Signed-off-by: Nathan Zender <github@nathanzender.com>
    zendern committed Feb 24, 2020
    Configuration menu
    Copy the full SHA
    5d857af View commit details
    Browse the repository at this point in the history
  24. Comment to make it clear why this nolint was added

    Signed-off-by: Nathan Zender <github@nathanzender.com>
    zendern committed Feb 24, 2020
    Configuration menu
    Copy the full SHA
    f48805a View commit details
    Browse the repository at this point in the history
  25. 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>
    zendern committed Feb 24, 2020
    Configuration menu
    Copy the full SHA
    6e5b06f View commit details
    Browse the repository at this point in the history
  26. io.Copy added to global errcheck exclude

    Signed-off-by: Nathan Zender <github@nathanzender.com>
    zendern committed Feb 24, 2020
    Configuration menu
    Copy the full SHA
    f910457 View commit details
    Browse the repository at this point in the history
  27. If error dont do anything else

    Signed-off-by: Nathan Zender <github@nathanzender.com>
    zendern committed Feb 24, 2020
    Configuration menu
    Copy the full SHA
    7d4ef02 View commit details
    Browse the repository at this point in the history
  28. Cleanup unused function

    Signed-off-by: Nathan Zender <github@nathanzender.com>
    zendern committed Feb 24, 2020
    Configuration menu
    Copy the full SHA
    eea746e View commit details
    Browse the repository at this point in the history
  29. Adding tracer to global excludes

    Signed-off-by: Nathan Zender <github@nathanzender.com>
    zendern committed Feb 24, 2020
    Configuration menu
    Copy the full SHA
    71c71e2 View commit details
    Browse the repository at this point in the history
  30. Cleanup post rebase

    Formatting and import issues that got missed when merging.
    
    Signed-off-by: Nathan Zender <github@nathanzender.com>
    zendern committed Feb 24, 2020
    Configuration menu
    Copy the full SHA
    2e09e2c View commit details
    Browse the repository at this point in the history
  31. 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>
    zendern committed Feb 24, 2020
    Configuration menu
    Copy the full SHA
    fec6e23 View commit details
    Browse the repository at this point in the history