Skip to content

Commit a422443

Browse files
author
irfan
committed
Adding gotest for golang
1 parent d9b9338 commit a422443

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

Diff for: custom.el

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
("ox-odt" . "https://kjambunathan.github.io/elpa/"))))
1313
'(package-selected-packages
1414
(quote
15-
(dashboard flycheck-rust ox-odt mustache-mode mustache lua-mode srcery-theme vscdark-theme use-package terraform-mode suscolors-theme smex ruby-hash-syntax rubocopfmt rubocop rspec-mode rg rbenv rainbow-delimiters racer protobuf-mode plantuml-mode ox-gfm org-present org-gcal org-bullets ob-sml ob-go night-owl-theme neotree lsp-ui load-env-vars kubernetes k8s-mode jsonnet-mode intero inkpot-theme inf-ruby indent-tools helm-rg helm-projectile gruvbox-theme go-snippets go-guru go-eldoc flymake-yaml flymake-rust flymake-ruby flymake-go flycheck-golangci-lint exec-path-from-shell erlang enh-ruby-mode emoji-cheat-sheet-plus dracula-theme doom-modeline dockerfile-mode docker-compose-mode docker company-lsp company-go company-emoji company-distel clojure-mode-extra-font-locking cider cargo auto-org-md atom-one-dark-theme ansible-vault ample-zen-theme all-the-icons-dired alchemist ace-window)))
15+
(gotest dashboard flycheck-rust ox-odt mustache-mode mustache lua-mode srcery-theme vscdark-theme use-package terraform-mode suscolors-theme smex ruby-hash-syntax rubocopfmt rubocop rspec-mode rg rbenv rainbow-delimiters racer protobuf-mode plantuml-mode ox-gfm org-present org-gcal org-bullets ob-sml ob-go night-owl-theme neotree lsp-ui load-env-vars kubernetes k8s-mode jsonnet-mode intero inkpot-theme inf-ruby indent-tools helm-rg helm-projectile gruvbox-theme go-snippets go-guru go-eldoc flymake-yaml flymake-rust flymake-ruby flymake-go flycheck-golangci-lint exec-path-from-shell erlang enh-ruby-mode emoji-cheat-sheet-plus dracula-theme doom-modeline dockerfile-mode docker-compose-mode docker company-lsp company-go company-emoji company-distel clojure-mode-extra-font-locking cider cargo auto-org-md atom-one-dark-theme ansible-vault ample-zen-theme all-the-icons-dired alchemist ace-window)))
1616
'(plantuml-default-exec-mode (quote jar))
1717
'(plantuml-jar-args (quote ("-charset" "UTF-8" "--illegal-access" "deny"))))
1818
(custom-set-faces

Diff for: go.org

+16-2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Should work with go mod projects.
88
Most of the heavy lifting should be ~lsp~ and ~gopls~
99
** Role of older tools
1010
This is based on how spacemacs go layer was structured, however key elements are changing for go mod support. Hence this is going to be in flux.
11+
1112
* Go Mode and hooks
1213

1314
#+BEGIN_SRC emacs-lisp
@@ -31,7 +32,8 @@ This is based on how spacemacs go layer was structured, however key elements are
3132
(add-hook 'go-mode-hook 'flycheck-mode)
3233

3334
(add-hook 'go-mode-hook '(lambda ()
34-
(local-set-key (kbd "C-c C-r") 'go-remove-unused-imports)))
35+
(local-set-key (kbd "C-c C-r") 'go-remove-unused-imports)
36+
(local-set-key (kbd "C-c b") 'go-run)))
3537
(add-hook 'go-mode-hook '(lambda ()
3638
(local-set-key (kbd "C-c C-g") 'go-goto-imports)))
3739
(add-hook 'go-mode-hook (lambda ()
@@ -42,6 +44,19 @@ This is based on how spacemacs go layer was structured, however key elements are
4244
(before-save . lsp-organize-imports)))
4345
#+END_SRC
4446

47+
* Testing
48+
#+BEGIN_SRC emacs-lisp
49+
(use-package gotest
50+
:ensure t
51+
:config
52+
(add-hook 'go-mode-hook '(lambda ()
53+
(local-set-key (kbd "C-c a") 'go-test-current-project)
54+
(local-set-key (kbd "C-c m") 'go-test-current-file)
55+
(local-set-key (kbd "C-c ,") 'go-test-current-test)
56+
))
57+
58+
)
59+
#+END_SRC
4560
* Go Completion
4661
#+Name: dump
4762
#+BEGIN_SRC emacs-lisp
@@ -86,7 +101,6 @@ This is based on how spacemacs go layer was structured, however key elements are
86101
(use-package go-snippets
87102
:ensure t)
88103
#+END_SRC
89-
90104
* babel support
91105
#+NAME: babel
92106
#+BEGIN_SRC emacs-lisp

0 commit comments

Comments
 (0)