1// errorcheck 2 3// Copyright 2020 The Go Authors. All rights reserved. 4// Use of this source code is governed by a BSD-style 5// license that can be found in the LICENSE file. 6 7package p 8 9type t struct{ x int } 10 11func f1() { 12 t{}.M() // ERROR "t{}.M undefined \(type t has no field or method M\)|undefined field or method .*M" 13 t{x: 1}.M() // ERROR "t{...}.M undefined \(type t has no field or method M\)|undefined field or method .*M|no field or method M" 14} 15 16func f2() (*t, error) { 17 return t{}.M() // ERROR "t{}.M undefined \(type t has no field or method M\)|undefined field or method .*M|not enough arguments" 18} 19