Skip to content

Commit

Permalink
doc/articles/wiki: highlight the use of _ warning
Browse files Browse the repository at this point in the history
This moves the paragraph mentioning the use of _ higher up
to emphasize the warning and thereby reducing chances of getting
stuck.

Fixes #22617

Change-Id: I64352a3e966a22d86fc9d381332bade49d74714a
Reviewed-on: https://go-review.googlesource.com/87375
Reviewed-by: Ian Lance Taylor <iant@golang.org>
  • Loading branch information
agnivade authored and ianlancetaylor committed Feb 14, 2018
1 parent 0519126 commit 32a0a1d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions doc/articles/wiki/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,12 @@ <h2>Using <code>net/http</code> to serve wiki pages</h2>

{{code "doc/articles/wiki/part2.go" `/^func viewHandler/` `/^}/`}}

<p>
Again, note the use of <code>_</code> to ignore the <code>error</code>
return value from <code>loadPage</code>. This is done here for simplicity
and generally considered bad practice. We will attend to this later.
</p>

<p>
First, this function extracts the page title from <code>r.URL.Path</code>,
the path component of the request URL.
Expand All @@ -282,12 +288,6 @@ <h2>Using <code>net/http</code> to serve wiki pages</h2>
HTML, and writes it to <code>w</code>, the <code>http.ResponseWriter</code>.
</p>

<p>
Again, note the use of <code>_</code> to ignore the <code>error</code>
return value from <code>loadPage</code>. This is done here for simplicity
and generally considered bad practice. We will attend to this later.
</p>

<p>
To use this handler, we rewrite our <code>main</code> function to
initialize <code>http</code> using the <code>viewHandler</code> to handle
Expand Down

0 comments on commit 32a0a1d

Please sign in to comment.