 
   ;; Font lock
   (set (make-local-variable 'font-lock-defaults)
-       '(go-mode-font-lock-keywords))
+       '(go--build-font-lock-keywords))
 
   ;; Indentation
   (set (make-local-variable 'indent-line-function) 'go-mode-indent-line)

(defconst go-identifier-regexp "[[:word:][:multibyte:]_]+")
(defconst go-type-regexp "[[:word:][:multibyte:]_*]+")
(defconst go-func-regexp (concat "\\<func\\>\\s *\\(" go-identifier-regexp "\\)"))
(defconst go-func-meth-regexp (concat "\\<func\\>\\s *\\((\\s *" go-identifier-regexp "\\s +" go-type-regexp "\\s *)\\s *\\)?\\(" go-identifier-regexp "\\)("))

(defvar go-mode-syntax-table
  (let ((st (make-syntax-table)))

some syntax analysis.")


(defun go--build-font-lock-keywords ()
  (message "%s" "Builting keywords...")
  (append
   `((,(regexp-opt go-mode-keywords 'words) . font-lock-keyword-face)
     (,(regexp-opt go-builtins 'words) . font-lock-builtin-face)
     (,(regexp-opt go-constants 'words) . font-lock-constant-face)
     (,go-func-regexp 1 font-lock-function-name-face) ;; function (not method) name
     )

   (if go-fontify-function-calls
       `((,(concat "\\(" go-identifier-regexp "\\)\\s *(") 1 font-lock-function-name-face) ;; function call/method name
         (,(concat "(\\(" go-identifier-regexp "\\))\\s *(") 1 font-lock-function-name-face)) ;; bracketed function call
     `((,go-func-meth-regexp 1 font-lock-function-name-face))) ;; method name

   `(
     ("\\<type\\>\\s *\\(\\S +\\)" 1 font-lock-type-face) ;; types
     (,(concat "\\<type\\>\\s *" go-identifier-regexp "\\s *" go-type-name-regexp) 1 font-lock-type-face) ;; types
     (,(concat "\\(?:[[:space:]]+\\|\\]\\)\\[\\([[:digit:]]+\\|\\.\\.\\.\\)?\\]" go-type-name-regexp) 2 font-lock-type-face) ;; Arrays/slices
     (,(concat "map\\[[^]]+\\]" go-type-name-regexp) 1 font-lock-type-face) ;; map value type
     (,(concat "\\(" go-identifier-regexp "\\)" "{") 1 font-lock-type-face)
     (,(concat "\\<map\\[" go-type-name-regexp) 1 font-lock-type-face) ;; map key type
     (,(concat "\\<chan\\>\\s *\\(?:<-\\)?" go-type-name-regexp) 1 font-lock-type-face) ;; channel type
     (,(concat "\\<\\(?:new\\|make\\)\\>\\(?:\\s \\|)\\)*(" go-type-name-regexp) 1 font-lock-type-face) ;; new/make type
     ;; TODO do we actually need this one or isn't it just a function call?
     (,(concat "\\.\\s *(" go-type-name-regexp) 1 font-lock-type-face) ;; Type conversion
     (,(concat "\\<func\\>\\s +(" go-identifier-regexp "\\s +" go-type-name-regexp ")") 1 font-lock-type-face) ;; Method receiver
     ;; Like the original go-mode this also marks compound literal
     ;; fields. There, it was marked as to fix, but I grew quite
     ;; accustomed to it, so it'll stay for now.
     ("^\\s *\\(\\w+\\)\\s *:\\(\\S.\\|$\\)" 1 font-lock-constant-face) ;; Labels and compound literal fields
     ("\\<\\(goto\\|break\\|continue\\)\\>\\s *\\(\\w+\\)" 2 font-lock-constant-face)))) ;; labels in goto/break/continue

(defvar go-mode-map
  (let ((m (make-sparse-keymap)))
