The use of a prefix check was too liberal.
Noted in review after submit.
Change-Id: I4fe1df660997efd225609e818040b8392fab79f0
Reviewed-on: https://go-review.googlesource.com/23375
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Andrew Gerrand <adg@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
os.Remove(tg.path("src/p1/p1.go"))
tg.mustNotExist(tg.path("src/p1/p1.go"))
- tg.tempFile("src/p2/p2.go", `
+ tg.tempFile("src/p2/p2.go", `//go:binary-only-packages-are-not-great
+
package p2
import "p1"
func F() { p1.F(true) }
}
line = bytes.TrimSpace(line)
if bytes.HasPrefix(line, slashslash) {
- if bytes.HasPrefix(line, binaryOnlyComment) {
+ if bytes.Equal(line, binaryOnlyComment) {
sawBinaryOnly = true
}
line = bytes.TrimSpace(line[len(slashslash):])