Skip to content

Latest commit

 

History

History
38 lines (30 loc) · 791 Bytes

README.md

File metadata and controls

38 lines (30 loc) · 791 Bytes

TDD in Go

This repository contains examples of use cases on how to use TDD in Go. It is based on the quii GitBook website.

Useful commands

Run a specific test:

$ go test -run <test_name> # example: go test -run TestHello

Run the tests of a specific directory:

$ cd <directory> # example: cd hello_world
$ go test

Run the tests of a specific directory and show the coverage:

$ cd <directory> # example: cd hello_world
$ go test -cover

Run the main function of a specific file:

$ go run <file_name>.go

Run a benchmark test for a specific directory

$ cd <directory> # example: cd hello_world
$ go test -bench=.

Run all the tests of the project:

$ go test ./...