branch: elpa/go-mode
commit c849d7299141a947e91067874b5c9f699fb232b7
Author: Lowe Thiderman <[email protected]>
Commit: Dominik Honnef <[email protected]>
Don't throw errors in some go-goto-* functions
By default, don't throw errors in go-goto-method-receiver and
go-goto-docstring when called interactively on anonymous functions.
Instead, assume that the user meant to run it on the surrounding named
function.
If they are called non-interactively with a prefix argument, we should
not throw an error about not being able to run on anonymous functions
either since we have explicitly asked to ignore them with the prefix
argument.
---
go-mode.el | 2 ++
1 file changed, 2 insertions(+)
diff --git a/go-mode.el b/go-mode.el
index 4aee729..b4cf1fa 100644
--- a/go-mode.el
+++ b/go-mode.el
@@ -1718,6 +1718,7 @@ an error is raised."
(interactive "P")
(when (and (not (called-interactively-p 'interactive))
+ (not arg)
(go--in-anonymous-funcion-p))
(error "Anonymous functions cannot have method receivers"))
@@ -1739,6 +1740,7 @@ an error is raised."
(interactive "P")
(when (and (not (called-interactively-p 'interactive))
+ (not arg)
(go--in-anonymous-funcion-p))
(error "Anonymous functions do not have docstrings"))