The Wayback Machine - https://web.archive.org/web/20230315111551/https://github.com/buoto/gotests-vim
Skip to content

buoto/gotests-vim

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

support gotests -template with config g:gotests_template
42abccb

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
doc
October 22, 2016 15:20
June 4, 2021 01:15
October 22, 2016 15:20
October 22, 2016 15:17
April 9, 2019 17:15

gotests-vim

Vim plugin for gotests, that allows you to generate table driven tests easily.

Usage

Call :GoTests to generate a test for the function at the current line or functions selected in visual mode.

Call :GoTestsAll to generate tests for all functions in the current buffer.

Installation

Gotests-vim requires gotests to be available in your $PATH. Alternatively you can provide path to gotests using g:gotests_bin setting.

Plugin installation:

  • Pathogen
  • git clone https://github.com/buoto/gotests-vim.git ~/.vim/bundle/gotests-vim
  • vim-plug
  • Plug 'buoto/gotests-vim'
  • NeoBundle
  • NeoBundle 'buoto/gotests-vim'
  • Vundle
  • Plugin 'buoto/gotests-vim'
  • Vim packages (since Vim 7.4.1528)
  • git clone https://github.com/buoto/gotests-vim.git ~/.vim/pack/plugins/start/gotests-vim

Settings

If you want you can set path to your gotests binary if it's not in your path, for example:

let g:gotests_bin = '/home/user/go/bin/gotests'

You can also set custom template directory:

let g:gotests_template_dir = '/home/user/templates/'