 ;; - 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.

          (setq line (format "%s \"%s\"" as import))
        (setq line (format "\"%s\"" import)))

      (goto-char (point-min))
      (if (re-search-forward (concat "^// import " line "$") nil t)
          (uncomment-region (line-beginning-position) (line-end-position))
        (case (go-goto-imports)
