soos

package module
v0.0.0-...-9e7b12f Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2020 License: MIT Imports: 4 Imported by: 0

README

soos

Go features to deal with the os package

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func Capture

func Capture(f *os.File) (dump func() ([]byte, error))

Capture reads from the *os.File until the dump func is called. The dump func returns the bytes captured since. The function is not thread safe.

Example
package main

import (
	"fmt"
	"os"

	"github.com/lebaptiste/soos"
)

func main() {
	fmt.Println("Hello Gophers!")

	dump := soos.Capture(os.Stdout)
	fmt.Println("How do you do?")
	stdout, _ := dump()

	fmt.Println("Goodbye!")
	fmt.Printf("captured: %v", string(stdout))

}
Output:

Hello Gophers!
How do you do?
Goodbye!
captured: How do you do?

Types

This section is empty.

Jump to

Keyboard shortcuts

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