mirror of https://github.com/golang/go.git
31 lines
506 B
Go
31 lines
506 B
Go
// Copyright 2022 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 decl
|
|
|
|
func a() {
|
|
var b, c bool // want `b declared but not used`
|
|
panic(c)
|
|
|
|
if 1 == 1 {
|
|
var s string // want `s declared but not used`
|
|
}
|
|
}
|
|
|
|
func b() {
|
|
// b is a variable
|
|
var b bool // want `b declared but not used`
|
|
}
|
|
|
|
func c() {
|
|
var (
|
|
d string
|
|
|
|
// some comment for c
|
|
c bool // want `c declared but not used`
|
|
)
|
|
|
|
panic(d)
|
|
}
|