mirror of
https://github.com/golang/go
synced 2024-10-02 22:25:08 +00:00
25 lines
453 B
Go
25 lines
453 B
Go
|
// errorcheck
|
||
|
|
||
|
// Copyright 2015 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.
|
||
|
|
||
|
// Check various syntax errors with switches.
|
||
|
|
||
|
package main
|
||
|
|
||
|
func _() {
|
||
|
switch {
|
||
|
case 0; // ERROR "expecting := or = or : or comma"
|
||
|
}
|
||
|
|
||
|
switch {
|
||
|
case 0; // ERROR "expecting := or = or : or comma"
|
||
|
default:
|
||
|
}
|
||
|
|
||
|
switch {
|
||
|
if x: // ERROR "expecting case or default or }"
|
||
|
}
|
||
|
}
|