mirror of
https://github.com/golang/go
synced 2024-11-18 10:54:40 -07:00
398bf9d5a0
This restores go.errors from before3af0d79
along with a fixed up version of the bisonerrors AWK script, translated to Go. However, this means Yyerror needs access to the yacc parser's state, which is currently private. To workaround that, add a "state" accessor method like the Lookahead method added inc7fa3c6
. Update issue #9968. Change-Id: Ib868789e92fdb7d135442120a392457923e50121 Reviewed-on: https://go-review.googlesource.com/7270 Reviewed-by: Russ Cox <rsc@golang.org> Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
29 lines
470 B
Go
29 lines
470 B
Go
// errorcheck
|
|
|
|
// Copyright 2012 The Go Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style
|
|
// license that can be found in the LICENSE file.
|
|
|
|
// Issue 4468: go/defer calls may not be parenthesized.
|
|
|
|
package p
|
|
|
|
type T int
|
|
|
|
func (t *T) F() T {
|
|
return *t
|
|
}
|
|
|
|
type S struct {
|
|
t T
|
|
}
|
|
|
|
func F() {
|
|
go (F()) // ERROR "must be function call"
|
|
defer (F()) // ERROR "must be function call"
|
|
var s S
|
|
(&s.t).F()
|
|
go (&s.t).F()
|
|
defer (&s.t).F()
|
|
}
|