Home

Awesome

GoUnit-Sublime License

GoUnit-Sublime makes writing better Go tests easy. It is an IDE plugin for Sublime Text 3 that uses gounit to generate table driven tests from selected function and method signatures. Any new dependencies in the test files are automatically imported.

Demo

demo

Installation

Prequisite: Use go get to install and update the gounit tool:

$ go get -u github.com/hexdigest/gounit/...

Next, install the GoUnit-Sublime plugin:

With Package Control:

  1. Run the Package Control: Install Package command
  2. Find and install GoUnit
  3. Restart Sublime Text (if required)

Manually:

  1. Clone this repo into your Packages folder
  2. Restart Sublime Text (if required)

Finally, open Preferences > Package Settings > GoUnit > Settings - User. In the newly created file, set your $GOPATH:

// GoUnit.sublime-settings
{
	// Add your GOPATH here.
	"GOPATH": "/absolute/go/path/"
}

Usage

Select some functions, right-click, and select Generate Go tests. This appends missing tests to an existing test file, or creates a new test file with them.

License

GoUnit-Sublime is released under the Apache 2.0 License.