Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/pumpkinseed/cage

Simple library to catch stdout/stderr in Go
https://github.com/pumpkinseed/cage

golang-library stdout testing testing-tool

Last synced: 2 days ago
JSON representation

Simple library to catch stdout/stderr in Go

Awesome Lists containing this project

README

        

# Cage

Simple library to catch stdout/stderr in Go.

#### Usage

```go
package main

import (
"fmt"
"os"

"github.com/PumpkinSeed/cage"
)

func main() {
c := cage.Start()

fmt.Println("test")
fmt.Println("test2")
fmt.Fprintln(os.Stderr, "stderr error")

cage.Stop(c)
fmt.Println(c.Data)
// [test, test2, stderr error]
}
```