Commit b47806d1 authored by Ingo Oeser's avatar Ingo Oeser Committed by Matthew Dempsky

cmd/compile: fix double go prefix trim

CL 106463 introduced what seems to trim the "go:" prefix in pramas
comments twice, so "//go:go:foo" would be handled, too.
So either the strings.TrimPrefix or the [3:]-slicing is not needed.

I opted to remove the [3:]-slicing.

Change-Id: I1325bbc08a9be9ae100c5a7775b0a23f9ed0a419
Reviewed-on: https://go-review.googlesource.com/107256Reviewed-by: 's avatarMatthew Dempsky <mdempsky@google.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent eef79b67
......@@ -96,7 +96,7 @@ func pragmaValue(verb string) syntax.Pragma {
func (p *noder) pragcgo(pos syntax.Pos, text string) {
f := pragmaFields(text)
verb := strings.TrimPrefix(f[0][3:], "go:")
verb := strings.TrimPrefix(f[0], "go:")
f[0] = verb
switch verb {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment