mirror of
https://github.com/golang/go
synced 2024-11-12 00:20:22 -07:00
7218b79f23
Change-Id: I22a8a233bc157fa09cd0283fcd4bc14d90faed70 Reviewed-on: https://go-review.googlesource.com/17066 Reviewed-by: Chris Manghane <cmang@golang.org>
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 }"
|
|
}
|
|
}
|