     (meta (get-text-property 0 'meta arg))
     (annotation
      (when company-go-show-annotation
-       (get-text-property 0 'meta arg)))
+       (company-go--extract-annotation (get-text-property 0 'meta arg))))
     (location (company-go--location arg))
     (sorted t)
     (post-completion

            (goto-char point)
            (company-go--godef-jump point)))
      (ignore-errors
         (with-current-buffer temp-buffer
           (set-buffer-modified-p nil))
        (kill-buffer temp-buffer)
        (delete-file temp)))))


(defun company-go--invoke-autocomplete ()
  (let ((temp-buffer (generate-new-buffer "*gocode*")))
    (prog2
        (call-process-region (point-min)
                             (point-max)
                             company-go-gocode-command
                             nil
                             temp-buffer
                             nil
                             "-f=csv"
                             "autocomplete"
                             (or (buffer-file-name) "")
                             (concat "c" (int-to-string (- (point) 1))))
        (with-current-buffer temp-buffer (buffer-string))
      (kill-buffer temp-buffer))))

(defun company-go--format-meta (candidate)
  (let ((class (nth 0 candidate))
        (name (nth 1 candidate))
        (type (nth 2 candidate)))
    (setq type (if (string-prefix-p "func" type)
                   (substring type 4 nil)
                 (concat " " type)))
    (concat class " " name type)))

(defun company-go--get-candidates (strings)
  (mapcar (lambda (str)
            (let ((candidate (split-string str ",,")))
              (propertize (nth 1 candidate) 'meta (company-go--format-meta candidate)))) strings))

(defun company-go--candidates ()
  (company-go--get-candidates (split-string (company-go--invoke-autocomplete) "\n" t)))
