       ;; We're using errbuf for the mixed stdout and stderr output. This
       ;; is not an issue because gofmt -w does not produce any stdout
       ;; output in case of success.
-      (if (zerop (call-process gofmt-command nil errbuf nil "-w" tmpfile))
+      (if (zerop (call-process gofmt-command nil errbuf nil "-w" (go--convert-path tmpfile)))
           (progn
             (if (zerop (call-process-region (point-min) (point-max) "diff" nil patchbuf nil "-n" "-" tmpfile))
                 (message "Buffer is already gofmted")

             (t
              (error "invalid rcs patch or internal error in go--apply-rcs-patch")))))))))

(defun gofmt ()
  "Format the current buffer according to the gofmt tool."
  (interactive)

                           "-i"
                           "-t"
                           "-f"
                           (go--convert-path (file-truename (buffer-file-name (go--coverage-origin-buffer))))
                           "-o"
                           (number-to-string (go--position-bytes point)))
      (with-current-buffer outbuf
