Skip to content

Latest commit

 

History

History
28 lines (20 loc) · 373 Bytes

README.md

File metadata and controls

28 lines (20 loc) · 373 Bytes

Cage

Simple library to catch stdout/stderr in Go.

Usage

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