}
// x[i:...
- // For better error message, don't simply use p.want(_Colon) here (issue #47704).
+ // For better error message, don't simply use p.want(_Colon) here (go.dev/issue/47704).
if !p.got(_Colon) {
p.syntaxError("expected comma, : or ]")
p.advance(_Comma, _Colon, _Rbrack)
// asking for a '{' rather than a ';' here leads to a better error message
p.want(_Lbrace)
if p.tok != _Lbrace {
- p.advance(_Lbrace, _Rbrace) // for better synchronization (e.g., issue #22581)
+ p.advance(_Lbrace, _Rbrace) // for better synchronization (e.g., go.dev/issue/22581)
}
}
if keyword == _For {
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-// Test case for issue 23434: Better synchronization of
+// Test case for go.dev/issue/23434: Better synchronization of
// parser after missing type. There should be exactly
// one error each time, with now follow errors.
type Map map[int] /* ERROR unexpected newline */
-// Examples from #23434:
+// Examples from go.dev/issue/23434:
func g() {
m := make(map[string] /* ERROR unexpected ! */ !)
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-// Test cases for issue 31092: Better synchronization of
+// Test cases for go.dev/issue/31092: Better synchronization of
// parser after seeing an := rather than an = in a const,
// type, or variable declaration.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-// This file is like map.go2, but instead if importing chans, it contains
+// This file is like map.go, but instead of importing chans, it contains
// the necessary functionality at the end of the file.
// Package orderedmap provides an ordered map, implemented as a binary tree.
// New returns a new map.
func New[K, V any](compare func(K, K) int) *Map[K, V] {
- return &Map[K, V]{compare: compare}
+ return &Map[K, V]{compare: compare}
}
// find looks up key in the map, and returns either a pointer
// Stop sending values if sender.Send returns false,
// meaning that nothing is listening at the receiver end.
return f(n.left) &&
- sender.Send(keyValue[K, V]{n.key, n.val}) &&
+ sender.Send(keyValue[K, V]{n.key, n.val}) &&
f(n.right)
}
go func() {
// A sender is used to send values to a Receiver.
type chans_Sender[T any] struct {
values chan<- T
- done <-chan bool
+ done <-chan bool
}
func (s *chans_Sender[T]) Send(v T) bool {
type chans_Receiver[T any] struct {
values <-chan T
- done chan<- bool
+ done chan<- bool
}
func (r *chans_Receiver[T]) Next() (T, bool) {
v, ok := <-r.values
return v, ok
-}
\ No newline at end of file
+}
func f[a b, /* ERROR expected ] */ 0] ()
-// issue #49482
+// go.dev/issue/49482
type (
t[a *[]int] struct{}
t[a *t,] struct{}
t[a *struct{}|~t] struct{}
)
-// issue #51488
+// go.dev/issue/51488
type (
t[a *t|t,] struct{}
t[a *t|t, b t] struct{}
_[_ t|~struct{}] t
_[_ ~t|~struct{}] t
- // test cases for issue #49175
+ // test cases for go.dev/issue/49175
_[_ []t]t
_[_ [1]t]t
_[_ ~[]t]t
t [ /* ERROR type parameters must be named */ t[0]]t
)
-// test cases for issue #49174
+// test cases for go.dev/issue/49174
func _[_ t]() {}
func _[_ []t]() {}
func _[_ [1]t]() {}