1
0
mirror of https://github.com/golang/go synced 2024-11-26 15:06:52 -07:00

doc/articles/wiki: use correct variable name in closures guide

Fixes non-existent variable TitleValidator to be validPath in
the closures, functions literal section.

Fixes #36779

Change-Id: I59762c358c3e00d1cc03d9d1e2aace03f145321d
GitHub-Last-Rev: a5e9b17a37
GitHub-Pull-Request: golang/go#36783
Reviewed-on: https://go-review.googlesource.com/c/go/+/216479
Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
This commit is contained in:
HowJMay 2020-03-20 08:40:38 +00:00 committed by Emmanuel Odeke
parent 635a83047b
commit 9d468f482f

View File

@ -674,7 +674,7 @@ The closure returned by <code>makeHandler</code> is a function that takes
an <code>http.ResponseWriter</code> and <code>http.Request</code> (in other
words, an <code>http.HandlerFunc</code>).
The closure extracts the <code>title</code> from the request path, and
validates it with the <code>TitleValidator</code> regexp. If the
validates it with the <code>validPath</code> regexp. If the
<code>title</code> is invalid, an error will be written to the
<code>ResponseWriter</code> using the <code>http.NotFound</code> function.
If the <code>title</code> is valid, the enclosed handler function