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

Miscellaneous lint cleanup #7747

Merged
merged 1 commit into from
Jan 10, 2017
Merged

Miscellaneous lint cleanup #7747

merged 1 commit into from
Jan 10, 2017

Conversation

mark-rushakoff
Copy link
Contributor

@mark-rushakoff mark-rushakoff commented Dec 19, 2016

  • Rebased/mergable
  • Tests pass

var out io.Writer = &e.LogOutput
if testing.Verbose() {
out = io.MultiWriter(out, os.Stderr)
}
e.QueryExecutor.WithLogger(zap.New(
zap.NewTextEncoder(),
zap.Output(os.Stderr),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What this supposed to be out from L199?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably. I'll amend the commit.

@@ -1208,7 +1208,7 @@ func (k *tsmKeyIterator) combine(dedup bool) blocks {
}

func (k *tsmKeyIterator) chunk(dst blocks) blocks {
for len(k.mergedValues) > k.size {
if len(k.mergedValues) > k.size {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be for since we are slicing values off on L1225 within the loop.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's no loop. There's a hardcoded return on the last line.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm. I'll have to look at when that changed. That may be a bug.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be an if as you have it. When the return was added, I forgot to switch it from a loop.

@@ -87,7 +87,7 @@ func (c *MetaClientMock) Databases() []meta.DatabaseInfo {
}

func (c *MetaClientMock) DeleteShardGroup(database string, policy string, id uint64) error {
return c.DeleteShardGroup(database, policy, id)
return c.DeleteShardGroupFn(database, policy, id)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clearly this was never being called in a test 🤦‍♂️

@e-dard
Copy link
Contributor

e-dard commented Jan 10, 2017

We should try and get this merged soon given it touches a lot of the code-base.

@mark-rushakoff
Copy link
Contributor Author

Waiting on @jwilder to make a decision on the (non-)loop in (*tsmKeyIterator).chunk. I can remove that part of the PR if we're going to defer that decision for later.

@mark-rushakoff mark-rushakoff merged commit a135906 into master Jan 10, 2017
@mark-rushakoff mark-rushakoff deleted the mr-lint-cleanup branch January 10, 2017 16:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants