Skip to content
Generate tests for go code from emacs
Emacs Lisp
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
LICENSE Initial commit Oct 16, 2017
README.md add setup info to readme Oct 23, 2017
go-gen-test.el fix docstring position in group declaration Oct 23, 2017

README.md

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)
You can’t perform that action at this time.