From 4d10da02637f806c90d5037919c03037077c8a89 Mon Sep 17 00:00:00 2001 From: Nick Snyder Date: Thu, 20 Sep 2018 13:02:08 -0700 Subject: [PATCH] Clarify error message when function is not an interface definition helps https://github.com/sourcegraph/go-langserver/issues/307 --- langserver/implementation.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/langserver/implementation.go b/langserver/implementation.go index 55521676..a950585b 100644 --- a/langserver/implementation.go +++ b/langserver/implementation.go @@ -73,7 +73,7 @@ func implements(fset *token.FileSet, lprog *loader.Program, pkgInfo *loader.Pack if obj, ok := pkgInfo.ObjectOf(id).(*types.Func); ok { recv := obj.Type().(*types.Signature).Recv() if recv == nil { - return nil, errors.New("this function is not a method") + return nil, errors.New("this function is not an interface definition") } method = obj T = recv.Type()