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

Remove some unnecessary import renames. #312

Merged
merged 1 commit into from
Sep 4, 2018

Conversation

monopole
Copy link
Contributor

@monopole monopole commented Aug 31, 2018

and an unnecessary creation of empty struct

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Aug 31, 2018
@monopole monopole requested a review from Liujingfang1 August 31, 2018 23:56
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: monopole

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Aug 31, 2018
@monopole monopole removed the request for review from pwittrock September 1, 2018 00:16
Copy link
Member

@mengqiy mengqiy left a comment

Choose a reason for hiding this comment

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

IIRC if there is a - in the package name, goimports linter will ask for an name alias.

@@ -17,7 +17,7 @@ limitations under the License.
package patch

import (
yamlpatch "github.com/krishicks/yaml-patch"
Copy link
Member

Choose a reason for hiding this comment

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

IIRC if you remove this goimports linter will complain about this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Absolutely true. That's why i disabled the goimports check in pre-commit.sh a while back (that's why this PR is passing).

goimports is broken for the case where the actual location of code has a hyphen, but the code itself has a package name that doesn't have a hyphen, e.g.

location: https://github.com/krishicks/yaml-patch
package name: https://github.com/krishicks/yaml-patch/blob/94f42521ff99ba62ddeca5ddae47264ade0b8df6/patch.go#L1

There's confusing discussion around this issue in golang/go#17546

I want to remove these aliases because the goland linter is (correctly) flagging them as unnecessary, and seeing these reports is adding noise to the report, making it more difficult to see real problems.

@Liujingfang1
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 4, 2018
@k8s-ci-robot k8s-ci-robot merged commit 95f5bec into kubernetes-sigs:master Sep 4, 2018
@monopole monopole deleted the fixSomeImports branch October 4, 2018 16:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants