Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pumpkinseed/cage
Simple library to catch stdout/stderr in Go
https://github.com/pumpkinseed/cage
golang-library stdout testing testing-tool
Last synced: 2 days ago
JSON representation
Simple library to catch stdout/stderr in Go
- Host: GitHub
- URL: https://github.com/pumpkinseed/cage
- Owner: PumpkinSeed
- License: apache-2.0
- Created: 2019-11-04T10:40:03.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2019-11-04T12:57:38.000Z (about 5 years ago)
- Last Synced: 2024-06-20T06:43:13.176Z (5 months ago)
- Topics: golang-library, stdout, testing, testing-tool
- Language: Go
- Homepage:
- Size: 7.81 KB
- Stars: 16
- Watchers: 3
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Cage
Simple library to catch stdout/stderr in Go.
#### Usage
```go
package mainimport (
"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]
}
```