diff --git a/modules/lang/go/README.org b/modules/lang/go/README.org index d8c1d5cd4..916c9abdd 100644 --- a/modules/lang/go/README.org +++ b/modules/lang/go/README.org @@ -26,6 +26,7 @@ This module adds [[https://golang.org][Go]] support. + Code navigation & refactoring (~go-guru~) + [[../../editor/file-templates/templates/go-mode][File templates]] + [[https://github.com/hlissner/doom-snippets/tree/master/go-mode][Snippets]] ++ Generate testing code (~go-gen-test~) ** Module Flags This module provides no flags. @@ -37,6 +38,7 @@ This module provides no flags. + [[https://github.com/manute/gorepl-mode][gorepl-mode]] + [[https://github.com/syohex/emacs-go-add-tags][go-add-tags]] + [[https://github.com/mdempsky/gocode][company-go]]* ++ [[https://github.com/s-kostyaev/go-gen-test][go-gen-test]] * Prerequisites ** Go @@ -66,6 +68,7 @@ This module requires a valid ~GOPATH~, and the following Go packages: + ~gore~ (for the REPL) + ~guru~ (for code navigation & refactoring commands) + ~goimports~ (optional: for auto-formatting code on save & fixing imports) ++ ~gotests~ (for generate test code) #+BEGIN_SRC sh export GOPATH=~/work/go @@ -76,6 +79,7 @@ go get -u golang.org/x/tools/cmd/godoc go get -u golang.org/x/tools/cmd/goimports go get -u golang.org/x/tools/cmd/gorename go get -u golang.org/x/tools/cmd/guru +go get -u github.com/cweill/gotests/... #+END_SRC * TODO Features diff --git a/modules/lang/go/config.el b/modules/lang/go/config.el index eaa37e862..0c13afd68 100644 --- a/modules/lang/go/config.el +++ b/modules/lang/go/config.el @@ -51,7 +51,10 @@ "t" #'+go/test-rerun "a" #'+go/test-all "s" #'+go/test-single - "n" #'+go/test-nested))) + "n" #'+go/test-nested + "g" #'go-gen-test-dwim + "G" #'go-gen-test-all + "e" #'go-gen-test-exported))) (use-package! gorepl-mode diff --git a/modules/lang/go/doctor.el b/modules/lang/go/doctor.el index 562dce962..37d002263 100644 --- a/modules/lang/go/doctor.el +++ b/modules/lang/go/doctor.el @@ -11,6 +11,9 @@ (unless (executable-find "gore") (warn! "Couldn't find gore. REPL will not work")) +(unless (executable-find "gotests") + (warn! "Couldn't find gotests. Generating tests will not work")) + (when (featurep! :completion company) (require 'company-go) (unless (executable-find company-go-gocode-command) diff --git a/modules/lang/go/packages.el b/modules/lang/go/packages.el index c5bb1bc70..bbf22ba0b 100644 --- a/modules/lang/go/packages.el +++ b/modules/lang/go/packages.el @@ -6,6 +6,7 @@ (package! go-mode) (package! gorepl-mode) (package! go-add-tags) +(package! go-gen-test) (when (featurep! :completion company) (package! company-go))