<commit_before>;;; packages.el --- Packages for go
;;; Code:

(defun go/init-go-mode ()
  "Initialize go related features."
  (progn
    (use-package go-mode
      :ensure t
      :defer t
      :config
      (add-hook 'go-mode-hook #'lsp)
      (add-hook 'before-save-hook #'gofmt-before-save)
      (setq gofmt-command "goimports"))
    (use-package go-rename
      :ensure t)
    (evil-add-command-properties #'godef-jump :jump t)
    (defvar core-go-mode-map (make-sparse-keymap))
    (define-key core-go-mode-map "rn" 'go-rename)
    (define-key core-go-mode-map "ta" 'go/go-tests-all)
    (define-key core-go-mode-map "tv" 'go/go-tests-all-verbose)
    (define-key core-go-mode-map "v" 'go/go-vendor)
    (add-hook 'go-mode-hook
              (lambda ()
                (core/leader core-local-leader-key core-go-mode-map)))))

(defvar go-test-buffer-name "*go test*"
  "Name of buffer for go test output.")

(defvar go-vendor-buffer-name "*go vendor*"
  "Name of buffer for go test output.")

(defun go/go-tests (args)
  (interactive)
  (compilation-start (concat "cd " (projectile-project-root)
                             " && " "go test " args)
                     nil (lambda (n) go-test-buffer-name) nil))

(defun go/go-tests-all ()
  (interactive)
  (go/go-tests "./..."))

(defun go/go-tests-all-verbose ()
  (interactive)
  (go/go-tests "./... -v"))


(defun go/go-vendor ()<commit_msg>Remove company capf from go completions<commit_after>;;; packages.el --- Packages for go
;;; Code:

(defun go/init-go-mode ()
  "Initialize go related features."
  (progn
    (use-package go-mode
      :ensure t
      :defer t
      :config
      (add-hook 'go-mode-hook #'lsp)
      (add-hook 'before-save-hook #'gofmt-before-save)
      (setq gofmt-command "goimports"))
    (use-package go-rename
      :ensure t)
    (evil-add-command-properties #'godef-jump :jump t)
    (defvar core-go-mode-map (make-sparse-keymap))
    (define-key core-go-mode-map "rn" 'go-rename)
    (define-key core-go-mode-map "ta" 'go/go-tests-all)
    (define-key core-go-mode-map "tv" 'go/go-tests-all-verbose)
    (define-key core-go-mode-map "v" 'go/go-vendor)
    (add-hook 'go-mode-hook
              (lambda ()
                (setq company-backends (delete 'company-capf company-backends))
                (core/leader core-local-leader-key core-go-mode-map)))))

(defvar go-test-buffer-name "*go test*"
  "Name of buffer for go test output.")

(defvar go-vendor-buffer-name "*go vendor*"
  "Name of buffer for go test output.")

(defun go/go-tests (args)
  (interactive)
  (compilation-start (concat "cd " (projectile-project-root)
                             " && " "go test " args)
                     nil (lambda (n) go-test-buffer-name) nil))

(defun go/go-tests-all ()
  (interactive)
  (go/go-tests "./..."))

(defun go/go-tests-all-verbose ()
  (interactive)
  (go/go-tests "./... -v"))


(defun go/go-vendor ()
{'fraction_non_alphanumeric': 0.1723901098901099, 'fraction_numerical': 0.0, 'mean_word_length': 2.379350348027842, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5856372', 'n_tokens_mistral': 1076, 'n_tokens_neox': 1064, 'n_words': 232}