mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
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/107256 Reviewed-by: Matthew Dempsky <mdempsky@google.com> Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
parent
eef79b6712
commit
b47806d1b5
1 changed files with 1 additions and 1 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue