 
     (with-current-buffer (or
                           (get-buffer gocov-buffer-name)
-                          (clone-indirect-buffer gocov-buffer-name nil))
+                          (make-indirect-buffer origin-buffer gocov-buffer-name t))
+      (set (make-local-variable 'go--coverage-origin-buffer) origin-buffer)
+      (set (make-local-variable 'go--coverage-current-file-name) coverage-file)
+
       (save-excursion
         (remove-overlays)
         (overlay-put

(defstruct go--covered
  start-line start-column end-line end-column covered count)

(defun go-coverage (input)
  "Open a clone of the current buffer and overlay it with
coverage information gathered via go test -coverprofile=INPUT."
  (interactive "fCoverage file: ")
  (let ((ranges '())
        (file-name (file-name-nondirectory (buffer-file-name)))
        (gocov-buffer-name (concat (buffer-name) "<gocov>"))
        (max-count 0)
        divisor)

    (with-temp-buffer
      (insert-file-contents input)
      (go--goto-line 2) ;; Skip over mode
      (while (not (eobp))
        (let* ((parts (split-string (buffer-substring (point-at-bol) (point-at-eol)) ":"))


            (overlay-put ov 'face face)
            (overlay-put ov 'help-echo (format "Count: %d" count)))))
      (if (not (eq cur-buffer (current-buffer)))
          (display-buffer (current-buffer) 'display-buffer-reuse-window)))))

(provide 'go-mode)
