Skip to content

reda-maizate/tdd-go

Repository files navigation

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 ./...

About

Examples of TDD use cases using Go

Topics

Resources

Stars

Watchers

Forks

Languages