Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jonasbn/go-test-demo
Basic go test demo and dummy
https://github.com/jonasbn/go-test-demo
demo dummy go gotest test
Last synced: 9 days ago
JSON representation
Basic go test demo and dummy
- Host: GitHub
- URL: https://github.com/jonasbn/go-test-demo
- Owner: jonasbn
- License: mit
- Created: 2020-05-21T16:31:10.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-08-24T05:05:11.000Z (about 2 years ago)
- Last Synced: 2024-06-20T12:04:07.946Z (5 months ago)
- Topics: demo, dummy, go, gotest, test
- Language: Go
- Homepage:
- Size: 207 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# go-test-demo
This is a basic repository I use for testing `gotest`, which provides colorful output, compared to the standard test tool.
Standard **go** toolchain:
```bash
go test -v
```![standard go test example screenshot](test-go-test-demo.png)
Using `gotest`
```bash
gotest -v
```![colorful gotest example screenshot](gotest-go-test-demo.png)
I use this repository for testing my contributions to `gotest`
```bash
gotest -v github.com/jonasbn/go-test-demo
```Do note that the above example expects for you to be in a directory containing a Go module project or else you will observe the following error:
> no required module provides package github.com/jonasbn/go-test-demo: go.mod file
> not found in current directory or any parent directory; see 'go help modules'You can do the following to get the demo to work, if you are not in the context of a Go module - it could be any, you could even fork and clone this here repository.
1. Create a directory
1. Initialize as a Go module
1. Install this demo
1. Run the `gotest` command```bash
mkdir gonow && \
go mod init example.com/gonow && \
go get github.com/jonasbn/go-test-demo
```And then you should be good to go
```bash
gotest -v github.com/jonasbn/go-test-demo
```## Resources and References
- [GitHub: rakyll/gotest](https://github.com/rakyll/gotest)
- [Go primary site](https://golang.org/doc/)
- [Go testing package](https://golang.org/pkg/testing/)