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

Comments

@atc0005
Copy link

@atc0005 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
Copy link
Contributor

@agnivade agnivade commented Jan 26, 2020

Interested in sending a PR ?

@gopherbot
Copy link

@gopherbot gopherbot commented Jan 26, 2020

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

@atc0005
Copy link
Author

@atc0005 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 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 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.

@gopherbot gopherbot closed this in 9d468f4 Mar 20, 2020
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

4 participants
You can’t perform that action at this time.