parent
63daee4b94
commit
89994b73a3
2 changed files with 41 additions and 1 deletions
|
@ -91,6 +91,39 @@ go install github.com/fatih/gomodifytags@latest
|
||||||
🔨 This module has no usage documentation yet. [[doom-contrib-module:][Write some?]]
|
🔨 This module has no usage documentation yet. [[doom-contrib-module:][Write some?]]
|
||||||
#+end_quote
|
#+end_quote
|
||||||
|
|
||||||
|
** Keybinds
|
||||||
|
| Keys | Description |
|
||||||
|
|---------------------+-------------------------------------------------------|
|
||||||
|
| [[kbd:][<localleader> a]] | Add field tags to a struct |
|
||||||
|
| [[kbd:][<localleader> d]] | Remove field tags from a struct |
|
||||||
|
| [[kbd:][<localleader> e]] | Evaluate buffer or selection in the Go playground |
|
||||||
|
| [[kbd:][<localleader> i]] | Go to imports |
|
||||||
|
| [[kbd:][<localleader> b c]] | run ~$ go clean~ |
|
||||||
|
| [[kbd:][<localleader> b b]] | run ~$ go build~ |
|
||||||
|
| [[kbd:][<localleader> b r]] | run ~$ go run .~ |
|
||||||
|
| [[kbd:][<localleader> h .]] | lookup symbol at point in godoc |
|
||||||
|
| [[kbd:][<localleader> h d]] | describe symbol at point |
|
||||||
|
| [[kbd:][<localleader> h v]] | list free variables |
|
||||||
|
| [[kbd:][<localleader> h i]] | list implements relations for package types |
|
||||||
|
| [[kbd:][<localleader> h p]] | list peers for channel |
|
||||||
|
| [[kbd:][<localleader> h P]] | "what does this point to" |
|
||||||
|
| [[kbd:][<localleader> h r]] | list references to object |
|
||||||
|
| [[kbd:][<localleader> h e]] | which errors |
|
||||||
|
| [[kbd:][<localleader> h w]] | what query |
|
||||||
|
| [[kbd:][<localleader> h c]] | show callers of function at point |
|
||||||
|
| [[kbd:][<localleader> h C]] | show callees of function at point |
|
||||||
|
| [[kbd:][<localleader> t t]] | rerun last test |
|
||||||
|
| [[kbd:][<localleader> t a]] | run all tests in project |
|
||||||
|
| [[kbd:][<localleader> t f]] | run all tests in current file |
|
||||||
|
| [[kbd:][<localleader> t s]] | run single test at point |
|
||||||
|
| [[kbd:][<localleader> t g]] | Generate tests for all exported or selected functions |
|
||||||
|
| [[kbd:][<localleader> t G]] | Generate tests for all functions |
|
||||||
|
| [[kbd:][<localleader> t e]] | Generate tests for all exported functions |
|
||||||
|
| [[kbd:][<localleader> t b s]] | go test.bench single |
|
||||||
|
| [[kbd:][<localleader> t b a]] | go test.bench all |
|
||||||
|
| [[kbd:][<localleader> r i a]] | search imports to add |
|
||||||
|
| [[kbd:][<localleader> r i r]] | reimove unused imports |
|
||||||
|
|
||||||
* TODO Configuration
|
* TODO Configuration
|
||||||
#+begin_quote
|
#+begin_quote
|
||||||
🔨 This module has no configuration documentation yet. [[doom-contrib-module:][Write some?]]
|
🔨 This module has no configuration documentation yet. [[doom-contrib-module:][Write some?]]
|
||||||
|
|
|
@ -17,6 +17,7 @@
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun +go/test-rerun ()
|
(defun +go/test-rerun ()
|
||||||
|
"Rerun last run test."
|
||||||
(interactive)
|
(interactive)
|
||||||
(if +go-test-last
|
(if +go-test-last
|
||||||
(+go--spawn +go-test-last)
|
(+go--spawn +go-test-last)
|
||||||
|
@ -24,16 +25,19 @@
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun +go/test-all ()
|
(defun +go/test-all ()
|
||||||
|
"Run all tests for this project."
|
||||||
(interactive)
|
(interactive)
|
||||||
(+go--run-tests ""))
|
(+go--run-tests ""))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun +go/test-nested ()
|
(defun +go/test-nested ()
|
||||||
|
"Run all tests in current directory and below, recursively."
|
||||||
(interactive)
|
(interactive)
|
||||||
(+go--run-tests "./..."))
|
(+go--run-tests "./..."))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun +go/test-single ()
|
(defun +go/test-single ()
|
||||||
|
"Run single test at point."
|
||||||
(interactive)
|
(interactive)
|
||||||
(if (string-match "_test\\.go" buffer-file-name)
|
(if (string-match "_test\\.go" buffer-file-name)
|
||||||
(save-excursion
|
(save-excursion
|
||||||
|
@ -43,6 +47,7 @@
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun +go/test-file ()
|
(defun +go/test-file ()
|
||||||
|
"Run all tests in current file."
|
||||||
(interactive)
|
(interactive)
|
||||||
(if (string-match "_test\\.go" buffer-file-name)
|
(if (string-match "_test\\.go" buffer-file-name)
|
||||||
(save-excursion
|
(save-excursion
|
||||||
|
@ -55,11 +60,13 @@
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun +go/bench-all ()
|
(defun +go/bench-all ()
|
||||||
|
"Run all benchmarks in project."
|
||||||
(interactive)
|
(interactive)
|
||||||
(+go--run-tests "-test.run=NONE -test.bench=\".*\""))
|
(+go--run-tests "-test.run=NONE -test.bench=\".*\""))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun +go/bench-single ()
|
(defun +go/bench-single ()
|
||||||
|
"Run benchmark at point."
|
||||||
(interactive)
|
(interactive)
|
||||||
(if (string-match "_test\\.go" buffer-file-name)
|
(if (string-match "_test\\.go" buffer-file-name)
|
||||||
(save-excursion
|
(save-excursion
|
||||||
|
@ -70,7 +77,7 @@
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun +go/play-buffer-or-region (&optional beg end)
|
(defun +go/play-buffer-or-region (&optional beg end)
|
||||||
"TODO"
|
"Evaluate active selection or buffer in the Go playground."
|
||||||
(interactive "r")
|
(interactive "r")
|
||||||
(if (use-region-p)
|
(if (use-region-p)
|
||||||
(go-play-region beg end)
|
(go-play-region beg end)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue