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