From de15dbe30dfb3bde6040b510e6c38068fa30167a Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Wed, 12 Oct 2022 13:56:34 -0400 Subject: [PATCH] _content/doc/comment: document form of directive comments Fixes golang/go#43776. Change-Id: I3e18dbe5dfb0bca96a16203efd4c2a92636cf412 Reviewed-on: https://go-review.googlesource.com/c/website/+/442516 Run-TryBot: Russ Cox TryBot-Result: Gopher Robot Reviewed-by: Ian Lance Taylor --- _content/doc/comment.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/_content/doc/comment.md b/_content/doc/comment.md index f1e547c1f1..4c8715e089 100644 --- a/_content/doc/comment.md +++ b/_content/doc/comment.md @@ -490,6 +490,11 @@ For example: //go:generate stringer -type Op -trimprefix Op type Op uint8 +A directive comment is a line matching the regular expression +`//(line |extern |export |[a-z0-9]+:[a-z0-9])`. +Tools that define their own directives should use the form +`//toolname:directive`. + Gofmt removes leading and trailing blank lines in doc comments. ### Paragraphs {#paragraphs}