 ;; - Fontify types in struct definitions
 ;; - Fontify unicode in method receiver types, array/slice/map types
 ;;   and everywhere where type-name is being used
+
+(eval-when-compile
+  (require 'diff-mode)
+  (require 'cl))
 
 (defconst go-dangling-operators-regexp "[^-]-\\|[^+]\\+\\|[/*&><.=|^]")
 (defconst gofmt-stdin-tag "<standard input>")

                      (message "%s" (point))
                    (put-text-property (1- (point)) (point) 'syntax-table (string-to-syntax "."))))))))))

(defun go--common-prefix (sequences)
  (assert sequences)
  (flet ((common-prefix (s1 s2)
                        (let ((diff-pos (mismatch s1 s2)))
                          (if diff-pos (subseq s1 0 diff-pos) s1))))
    (reduce #'common-prefix sequences)))

(defun go-import-add (arg import)
  "Add a new import to the list of imports.

              (coding-system-for-read 'utf-8)    ;; use utf-8 with subprocesses
              (coding-system-for-write 'utf-8))
          (with-current-buffer errbuf
            (let ((inhibit-read-only t))
              (erase-buffer)))
          (with-current-buffer srcbuf
            (save-restriction
              (let (deactivate-mark)
