     (insert " ")
     (backward-char 1)))
 
-(defun go-goto-method-receiver ()
+(defun go-goto-method-receiver (&optional arg)
   "Go to the receiver of the current method.
 
-If there is none, add parenthesis to add one."
-  (interactive)
-
-  (when (go--in-anonymous-funcion-p)
+If there is none, add parenthesis to add one.
+
+Anonymous functions cannot have method receivers, so when this is called
+interactively anonymous functions will be skipped. If called programmatically,
+an error is raised."
+  (interactive "P")
+
+  (when (and (not (called-interactively-p 'interactive))
+             (go--in-anonymous-funcion-p))
     (error "Anonymous functions cannot have method receivers"))
 
-  (go-goto-function)
+  (go-goto-function '(4))  ; Always skip anonymous functions
   (forward-char 5)
   (when (not (looking-at "("))
     (save-excursion
       (insert "() ")))
   (forward-char 1))
 
-(defun go-goto-docstring ()
+(defun go-goto-docstring (&optional arg)
   "Go to the top of the docstring of the current function.
 
-If there is none, add slashes to start writing one."
-  (interactive)
-  (go-goto-function)
+If there is none, add slashes to start writing one.
+
+Anonymous functions do not have docstrings, so when this is called
+interactively anonymous functions will be skipped. If called programmatically,
+an error is raised."
+  (interactive "P")
+
+  (when (and (not (called-interactively-p 'interactive))
+             (go--in-anonymous-funcion-p))
+    (error "Anonymous functions do not have docstrings"))
+
+  (go-goto-function '(4))
   (forward-line -1)
   (beginning-of-line)
 

      (when (looking-at "Test")
        (forward-char 4)))))

(defun go-goto-arguments ()
  "Go to the arguments of the current function."
  (interactive)
  (go-goto-function-name)
  (forward-word 1)
  (forward-char 1))

(defun go--goto-return-values ()
  "Go to the declaration of return values for the current function."
  (go-goto-arguments)
  (backward-char)
  (forward-list)
  (forward-char))

(defun go-goto-return-value ()
  "Go to the return value declaration of the current function.

If there are multiple ones contained in a parenthesis, enter the parenthesis.
If there is none, make space for one to be added."
  (interactive)
  (go--goto-return-values)

  ;; Opening parenthesis, enter it
  (when (looking-at "(")

      ;; were not inside it but below it. If we were not inside it, we should
      ;; go to the containing function.
      (while (go--in-function-p p)
        (go-goto-function arg)))))

  (cond
   ((go-in-comment-p)
    ;; If we are still in a comment, redo the call so that we get out of it.
    (go-goto-function arg))

   ((and (looking-at "func(") (equal arg '(4)))
    ;; If we are looking at an anonymous function and a prefix argument has
    ;; been supplied, redo the call so that we skip the anonymous function.
    (go-goto-function arg))))

(defun go--in-function-p (compare-point)
  "Return t if `compare-point' is inside the function that point is currently on.
