Add support for go-gen-test

This commit is contained in:
nobv 2019-10-23 01:06:46 +09:00
parent 0ccf31635d
commit 5de62574bc
4 changed files with 13 additions and 1 deletions

View file

@ -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

View file

@ -51,7 +51,11 @@
"t" #'+go/test-rerun
"a" #'+go/test-all
"s" #'+go/test-single
"n" #'+go/test-nested)))
"n" #'+go/test-nested)
(:prefix ("gt" . "gen-test")
"d" #'go-gen-test-dwim ; Generate tests for functions you want to.
"a" #'go-gen-test-all ; Generate tests for all functions.
"e" #'go-gen-test-exported))) ; Generate tests for all exported functions.
(use-package! gorepl-mode

View file

@ -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)

View file

@ -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))