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

x/website: Potential reference to wrong variable name "TitleValidator" #36779

Closed
atc0005 opened this issue Jan 26, 2020 · 5 comments
Closed

x/website: Potential reference to wrong variable name "TitleValidator" #36779

atc0005 opened this issue Jan 26, 2020 · 5 comments
Labels
Documentation FrozenDueToAge help wanted NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@atc0005
Copy link

atc0005 commented Jan 26, 2020

While reading this article:

https://golang.org/doc/articles/wiki/

I got to the point where the author is explaining how the makeHandler function uses the regex created earlier to validate the title provided by the user.

The closure extracts the title from the request path, and validates it with the TitleValidator regexp.

The actual variable name is validPath. From the way the explanation is written, it seems that the text should instead be:

The closure extracts the title from the request path, and validates it with the validPath regexp.


Many thanks for writing this article. I learned a lot and plan to reference it often as I continue to learn more about Go and writing web apps.

@gopherbot gopherbot added this to the Unreleased milestone Jan 26, 2020
@agnivade agnivade added Documentation NeedsFix The path to resolution is known, but the work has not been done. labels Jan 26, 2020
@agnivade
Copy link
Contributor

Interested in sending a PR ?

@gopherbot
Copy link

Change https://golang.org/cl/216479 mentions this issue: x/website: Fix wrong variable name

@atc0005
Copy link
Author

atc0005 commented Jan 26, 2020

@agnivade Interested in sending a PR ?

Looks like @howjmay beat me to it (thanks!). When I initially submitted this I was also unsure whether I was misreading the quoted line. Glad to see that I was correct and had the right understanding. :)

@howjmay
Copy link
Contributor

howjmay commented Jan 26, 2020

Don't worry I can close my PR now. I thought you may be not willing fix this by yourself. I am sorry 😵

@atc0005
Copy link
Author

atc0005 commented Jan 26, 2020

@howjmay Don't worry I can close my PR now. I thought you may be not willing fix this by yourself. I am sorry

No, no, it was an honest (non-sarcastic) Thank You for submitting your PR. Please, by all means please proceed with your PR. I was actually really impressed that someone was already actively working to resolve the issue.

howjmay added a commit to howjmay/go that referenced this issue Mar 20, 2020
Fixes non-existent variable TitleValidator to be validPath in
the closures, functions literal section.

Fixes golang#36779
@golang golang locked and limited conversation to collaborators Mar 20, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Documentation FrozenDueToAge help wanted NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants