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

server/embed: address golangci var-naming issues #17820

Merged

Conversation

ivanvc
Copy link
Member

@ivanvc ivanvc commented Apr 18, 2024

Addresses issues in ListenPeerUrls, ListenClientUrls, ListenClientHttpUrls, AdvertisePeerUrls, AdvertiseClientUrls.

Following the same approach as in #17674, a linter ignore is added to these exported fields. However, non-exported functions and exported struct fields used only for JSON marshaling can be safely renamed.

Part of #17578.

Please read https://github.com/etcd-io/etcd/blob/main/CONTRIBUTING.md#contribution-flow.

Addresses issues in ListenPeerUrls, ListenClientUrls,
ListenClientHttpUrls, AdvertisePeerUrls, AdvertiseClientUrls.

Signed-off-by: Ivan Valdes <[email protected]>
Comment on lines -452 to +459
ListenPeerUrls string `json:"listen-peer-urls"`
ListenClientUrls string `json:"listen-client-urls"`
ListenClientHttpUrls string `json:"listen-client-http-urls"`
AdvertisePeerUrls string `json:"initial-advertise-peer-urls"`
AdvertiseClientUrls string `json:"advertise-client-urls"`
ListenPeerURLs string `json:"listen-peer-urls"`
ListenClientURLs string `json:"listen-client-urls"`
ListenClientHTTPURLs string `json:"listen-client-http-urls"`
AdvertisePeerURLs string `json:"initial-advertise-peer-urls"`
AdvertiseClientURLs string `json:"advertise-client-urls"`
Copy link
Member Author

Choose a reason for hiding this comment

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

As stated in the PR description, these are exported fields from an unexported struct. It's internally used to marshal/unmarshal JSONs. So, it should be fine to rename.

Copy link
Member

Choose a reason for hiding this comment

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

Right

Comment on lines +64 to +67
ListenPeerURLs string `json:"listen-peer-urls"`
ListenClientURLs string `json:"listen-client-urls"`
ListenClientHTTPURLs string `json:"listen-client-http-urls"`
AdvertiseClientURLs string `json:"advertise-client-urls"`
Copy link
Member Author

Choose a reason for hiding this comment

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

As stated in the PR description, these are used only for tests marshaling the config into JSON, so it should be safe to rename them.

@ivanvc ivanvc mentioned this pull request Apr 18, 2024
20 tasks
@ivanvc
Copy link
Member Author

ivanvc commented Apr 19, 2024

/retest

@ahrtr ahrtr merged commit 2674f94 into etcd-io:main Apr 20, 2024
43 checks passed
@ivanvc ivanvc deleted the address-server-embed-var-naming-lint-rule-pt2 branch April 21, 2024 03:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants