       ;; were not inside it but below it. If we were not inside it, we should
       ;; go to the containing function.
       (while (and (not (go--in-function-p p))
-                  (not (looking-at "^func")))
+                  (not (looking-at "^func\\>")))
         (go-goto-function arg)))))
 
   (cond

    ;; 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(") arg)
    ;; 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))))

  "Return t if point is inside an anonymous function, nil otherwise."
  (save-excursion
    (go-goto-function)
    (looking-at "\\<func(")))

(define-prefix-command 'go-goto-map)
(define-key go-mode-map (kbd "C-c C-g") 'go-goto-map)
