]> Cypherpunks repositories - gostls13.git/commit
cmd/cover: preserve compiler directives in floating comments
authorJay Conrod <jayconrod@google.com>
Tue, 10 Oct 2017 18:41:57 +0000 (14:41 -0400)
committerRobert Griesemer <gri@golang.org>
Mon, 16 Oct 2017 23:38:38 +0000 (23:38 +0000)
commit38a3c2cfe95cef0e4f101cfb82c5586a9db4cbd8
tree86255c71b377aebc514e2ead08df89f7273b54ea
parentf75158c36530ba902a011a69243d1d51c1ba3a46
cmd/cover: preserve compiler directives in floating comments

Previously, cover printed directives (//go: comments) near the top of
the file unless they were in doc comments. However, directives
frequently apply to specific definitions, and they are not written in
doc comments to prevent godoc from printing them. Moving all
directives to the top of the file affected semantics of tests.

With this change, directives are kept together with the following
top-level declarations. Only directives that occur after all top-level
declarations are moved.

Fixes #22022

Change-Id: Ic5c61c4d3969996e4ed5abccba0989163789254c
Reviewed-on: https://go-review.googlesource.com/69630
Run-TryBot: Emmanuel Odeke <emm.odeke@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
Reviewed-by: Alan Donovan <adonovan@google.com>
misc/nacl/testzip.proto
src/cmd/cover/cover.go
src/cmd/cover/cover_test.go
src/cmd/cover/doc.go
src/cmd/cover/testdata/directives.go [new file with mode: 0644]