mirror of
https://github.com/golang/go
synced 2024-11-22 05:24:39 -07:00
parent
4b40426a90
commit
78c27ed650
@ -43,4 +43,10 @@ static struct {
|
|||||||
|
|
||||||
% loadsys package imports LFUNC LNAME '(' ')' '{' LFOR LVAR LNAME '=' LNAME
|
% loadsys package imports LFUNC LNAME '(' ')' '{' LFOR LVAR LNAME '=' LNAME
|
||||||
"var declaration not allowed in for initializer",
|
"var declaration not allowed in for initializer",
|
||||||
|
|
||||||
|
% loadsys package imports LVAR LNAME '[' ']' LNAME '{'
|
||||||
|
"var declaration missing = before initial value",
|
||||||
|
|
||||||
|
% loadsys package imports LFUNC LNAME '(' ')' '{' LVAR LNAME '[' ']' LNAME '{'
|
||||||
|
"var declaration missing = before initial value",
|
||||||
};
|
};
|
||||||
|
10
test/syntax/vareq.go
Normal file
10
test/syntax/vareq.go
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
// errchk $G -e $D/$F.go
|
||||||
|
|
||||||
|
// Copyright 2010 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.
|
||||||
|
|
||||||
|
package main
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
var x map[string]string{"a":"b"} // ERROR "var declaration missing ="
|
10
test/syntax/vareq1.go
Normal file
10
test/syntax/vareq1.go
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
// errchk $G -e $D/$F.go
|
||||||
|
|
||||||
|
// Copyright 2010 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.
|
||||||
|
|
||||||
|
package main
|
||||||
|
|
||||||
|
var x map[string]string{"a":"b"} // ERROR "var declaration missing ="
|
||||||
|
|
Loading…
Reference in New Issue
Block a user