cmd/doc: submit to the punched card tyranny

People use 80-column terminals because their grandparents used
punched cards. When I last used a punched card, in 1978, it seemed
antiquated even then. But today, people still set their terminal
widths to 80 to honor the struggles their fallen ancestors made to
endure this painful technology.

We must all stand and salute the 80 column flag, or risk the opprobium
of our peers.

For Pete's sake, I don't even use a fixed-width font. I don't even
believe in columns.

Fixes #11639 with extreme reluctance.

P.S. To avoid the horror of an automatically folded line of text, this commit message has been formatted to fit on an 80-column line, except for this postscript.

Change-Id: Ia2eb2dcf293dabe804c22ee5abb4bbb703f45c33
Reviewed-on: https://go-review.googlesource.com/12011
Reviewed-by: Ian Lance Taylor <iant@golang.org>
diff --git a/src/cmd/doc/pkg.go b/src/cmd/doc/pkg.go
index 5192b02..569c7a3 100644
--- a/src/cmd/doc/pkg.go
+++ b/src/cmd/doc/pkg.go
@@ -20,6 +20,12 @@
 	"unicode/utf8"
 )
 
+const (
+	punchedCardWidth = 80 // These things just won't leave us alone.
+	indentedWidth    = punchedCardWidth - len(indent)
+	indent           = "    "
+)
+
 type Package struct {
 	writer     io.Writer // Destination for output.
 	name       string    // Package name, json for encoding/json.
@@ -135,7 +141,7 @@
 		}
 		if comment != "" {
 			pkg.newlines(2) // Guarantee blank line before comment.
-			doc.ToText(&pkg.buf, comment, "    ", "\t", 80)
+			doc.ToText(&pkg.buf, comment, "    ", indent, indentedWidth)
 		}
 		pkg.newlines(1)
 	}
@@ -204,7 +210,7 @@
 		pkg.packageClause(false)
 	}
 
-	doc.ToText(&pkg.buf, pkg.doc.Doc, "", "\t", 80)
+	doc.ToText(&pkg.buf, pkg.doc.Doc, "", indent, indentedWidth)
 	pkg.newlines(1)
 
 	if !pkg.showInternals() {