mirror of
https://github.com/golang/go
synced 2024-11-17 22:14:43 -07:00
d6abf298cf
As of https://golang.org/cl/273886: fixedbugs/bug340.go:15:18: error: reference to method ‘x’ in interface with no methods For golang/go#10700 Change-Id: Id29eb0e34bbb524117614229c4c27cfd17dae286 Reviewed-on: https://go-review.googlesource.com/c/go/+/273887 Trust: Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Cherry Zhang <cherryyz@google.com>
18 lines
399 B
Go
18 lines
399 B
Go
// errorcheck
|
|
|
|
// Copyright 2011 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.
|
|
|
|
// Issue 1606.
|
|
|
|
package main
|
|
|
|
func main() {
|
|
var x interface{}
|
|
switch t := x.(type) {
|
|
case 0: // ERROR "type"
|
|
t.x = 1 // ERROR "type interface \{\}|reference to undefined field or method|interface with no methods"
|
|
}
|
|
}
|