From 32a0a1d37c87bbbc5f9650da9a4b7262f3162ae4 Mon Sep 17 00:00:00 2001 From: Agniva De Sarker Date: Thu, 11 Jan 2018 22:19:01 +0530 Subject: [PATCH] doc/articles/wiki: highlight the use of _ warning 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 --- doc/articles/wiki/index.html | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/doc/articles/wiki/index.html b/doc/articles/wiki/index.html index 3e0d532d7f..b7ab2cc622 100644 --- a/doc/articles/wiki/index.html +++ b/doc/articles/wiki/index.html @@ -268,6 +268,12 @@ view a wiki page. It will handle URLs prefixed with "/view/". {{code "doc/articles/wiki/part2.go" `/^func viewHandler/` `/^}/`}} +

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

+

First, this function extracts the page title from r.URL.Path, the path component of the request URL. @@ -282,12 +288,6 @@ The function then loads the page data, formats the page with a string of simple HTML, and writes it to w, the http.ResponseWriter.

-

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

-

To use this handler, we rewrite our main function to initialize http using the viewHandler to handle -- 2.50.0