https://github.com/rhysd/gotest
Tiny single script to colorize `go test`
https://github.com/rhysd/gotest
go testing
Last synced: about 1 year ago
JSON representation
Tiny single script to colorize `go test`
- Host: GitHub
- URL: https://github.com/rhysd/gotest
- Owner: rhysd
- License: mit
- Created: 2018-11-15T08:30:49.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2023-02-16T03:01:26.000Z (over 3 years ago)
- Last Synced: 2025-04-15T20:16:21.510Z (about 1 year ago)
- Topics: go, testing
- Language: Ruby
- Homepage:
- Size: 7.81 KB
- Stars: 12
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
Colorize `go test`
==================
[![CI][ci-badge]][ci]
This repository provides a tiny script to colorize `go test`.

## Prerequisites
- `/bin/bash`
- `sed`
## Installation
1. Copy [`gotest`](gotest) script to your `$PATH` directory
2. Give it executable permission with `chmod +x`
On CI, directly downloading `gotest` with `curl` would be sufficient in most cases as follows.
```sh
$ curl -L https://raw.githubusercontent.com/rhysd/gotest/master/gotest > gotest
$ bash ./gotest
```
## Usage
```
$ gotest [args...]
```
Arguments are the same as `go test` but `-v` is always implied.
The reason I created this in spite of [rakyll/gotest](https://github.com/rakyll/gotest) is that
my requirements can be met with only ~20 lines of shell script. Smaller script is better because
it can be modified/fixed easily and easy to understand and easy to test.
## Change colors
If you want to change colors, please modify [the script](gotest) directly. The color definitions at
top of the script (e.g. `92` for green, `91` for red) are [ANSI escape sequences for colors][ansi-colors].
Please modify them to use your favorite colors.
## License
[MIT License](LICENSE.txt)
[ci-badge]: https://github.com/rhysd/gotest/actions/workflows/ci.yaml/badge.svg
[ci]: https://github.com/rhysd/gotest/actions/workflows/ci.yaml
[ansi-colors]: https://en.wikipedia.org/wiki/ANSI_escape_code#Colors