Documentation
¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Capture ¶
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.
Click to show internal directories.
Click to hide internal directories.