cage

package module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 4, 2019 License: Apache-2.0 Imports: 5 Imported by: 1

README

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Start

func Start() *container

func Stop

func Stop(c *container)

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL