Skip to content

PumpkinSeed/cage

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Simple library to catch stdout/stderr in Go

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages