SandpointsGitHook/vendor/github.com/PumpkinSeed/cage
2020-12-02 17:02:11 +01:00
..
.gitignore initial commit with go vendor and compiled binary 2020-12-02 17:02:11 +01:00
cage.go initial commit with go vendor and compiled binary 2020-12-02 17:02:11 +01:00
go.mod initial commit with go vendor and compiled binary 2020-12-02 17:02:11 +01:00
LICENSE initial commit with go vendor and compiled binary 2020-12-02 17:02:11 +01:00
README.md initial commit with go vendor and compiled binary 2020-12-02 17:02:11 +01:00

# 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]
}
```