From 3b081dae265eca6cfcdf31868041b053c4768d1a Mon Sep 17 00:00:00 2001 From: Mark McGranaghan Date: Tue, 16 Oct 2012 10:39:00 -0700 Subject: [PATCH] explain tricky err switch --- examples/line-filters/line-filters.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/line-filters/line-filters.go b/examples/line-filters/line-filters.go index 8cd9af5..38f60bc 100644 --- a/examples/line-filters/line-filters.go +++ b/examples/line-filters/line-filters.go @@ -31,9 +31,9 @@ func main() { for { switch line, err := rdr.ReadString('\n'); err { - // If the read succeeded, write out out the - // uppercased line. Check for an error on the - // write as we do on the read. + // If the read succeeded (the read `err` is nil), + // write out out the uppercased line. Check for an + // error on this write as we do on the read. case nil: ucl := strings.ToUpper(line) if _, err = out.WriteString(ucl); err != nil {