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

Address a few linter errors #3780

Merged
merged 5 commits into from
Jan 11, 2023
Merged

Conversation

mindaugasrukas
Copy link
Contributor

What changed?
I fixed a few code quality errors that were annoying me:

  • Removed unreachable code
  • Renamed variables and identifiers that shadows import names

Why?
Code quality

How did you test it?
CI

Potential risks
No

Is hotfix candidate?
Revert

@mindaugasrukas mindaugasrukas requested a review from a team as a code owner January 6, 2023 02:46
@@ -39,7 +39,7 @@ import (
"go.temporal.io/server/common/persistence"
"go.temporal.io/server/common/quotas"
"go.temporal.io/server/common/timer"
"go.temporal.io/server/service/history/shard"
hshard "go.temporal.io/server/service/history/shard"
Copy link
Contributor

Choose a reason for hiding this comment

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

We only have the concept in history so I guess it is ok just use shard?

Copy link
Contributor Author

@mindaugasrukas mindaugasrukas Jan 6, 2023

Choose a reason for hiding this comment

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

The problem is that the shard identifier conflicts with many variables named shard.
For example: shard shard.Context
So I have two options:

  • rename the identifier to something else
  • rename all variables to something else (for example, shardContext)

I think renaming the identifier is more readable.

What do you think?

Copy link
Member

Choose a reason for hiding this comment

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

👍 I guess I am ok with either option. cc @yux0

Copy link
Contributor

Choose a reason for hiding this comment

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

I see after the linter plugin.

@@ -39,7 +39,7 @@ import (
"go.temporal.io/server/common/persistence"
"go.temporal.io/server/common/quotas"
"go.temporal.io/server/common/timer"
"go.temporal.io/server/service/history/shard"
hshard "go.temporal.io/server/service/history/shard"
Copy link
Member

Choose a reason for hiding this comment

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

👍 I guess I am ok with either option. cc @yux0

@mindaugasrukas mindaugasrukas merged commit c5254f3 into temporalio:master Jan 11, 2023
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.

3 participants