Skip to content

s-kostyaev/go-gen-test

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 

Repository files navigation

go-gen-test

License GPL 3 MELPA

go-gen-test is package for generating tests for go code from emacs. It is simple wrapper around gotests.

asciicast

Usage

Commands

go-gen-test-dwim

Generate tests for functions you want to. If you call this function while region is active it extracts functions defined in this region and generate tests for it. Else it generates tests for exported or all functions. You can customize this behavior with go-gen-test-default-functions.

go-gen-test-all

Generate tests for all functions.

go-gen-test-exported

Generate tests for all exported functions.

Customization

M-x customize-group Enter go-gen-test Enter

Setup

You can now install package go-gen-test from MELPA. Just M-x package-installEnter go-gen-test Enter.

Also you should install gotests:

$ go get -u github.com/cweill/gotests/...

Then you can bind needed commands to preffered keys:

(defun my-go-gen-test-setup ()
  "My keybindings for generating go tests."
  (interactive)
  (local-set-key (kbd "C-c C-g") #'go-gen-test-dwim))

(add-hook 'go-mode-hook #'my-go-gen-test-setup)

About

Generate tests for go code from emacs

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published