       (skip-chars-forward "^{")
       (forward-char)
       (or (go-in-string-or-comment-p)
-          (looking-back "\\(struct\\|interface\\)\\s-*{"))))
+          (looking-back "\\(struct\\|interface\\)\\s-*{"
+                        (line-beginning-position)))))
     (setq orig-level (go-paren-level))
     (while (>= (go-paren-level) orig-level)
       (skip-chars-forward "^}")

           (skip-chars-forward "^{")
           (forward-char)
           (or (go-in-string-or-comment-p)
               (looking-back "\\(struct\\|interface\\)\\s-*{"))))
  (backward-char))

(defun go--in-function-p (compare-point)

  (let (pos (start-pos (point)))
    (skip-chars-backward "\n\s\t")
    (if (and (save-excursion (beginning-of-line) (go-in-string-p))
             (= (char-before) ?`)
             (not stop-at-string))
        (backward-char))
    (if (and (go-in-string-p)
             (not stop-at-string))
        (go-goto-beginning-of-string-or-comment))
    (if (looking-back "\\*/" (line-beginning-position))
        (backward-char))
    (if (go-in-comment-p)
        (go-goto-beginning-of-string-or-comment))
