Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DiscardStdout ¶
func DiscardStdout() error
DiscardStdout Discard os.Stdout output Usage:
DiscardStdout() fmt.Println("Hello, playground") RestoreStdout()
func MockEnvValue ¶ added in v0.1.6
MockEnvValue will store old env value, set new val. will restore old value on end.
func MockEnvValues ¶ added in v0.1.6
MockEnvValues will store old env value, set new val. will restore old value on end.
func MockRequest ¶
MockRequest mock an HTTP Request Usage:
handler := router.New() res := mockRequest(handler, "GET", "/path", nil) // with data body := strings.NewReader("string ...") res := mockRequest(handler, "GET", "/path", &MD{Body: "data", Headers: M{"x-head": "val"}})
func RewriteStdout ¶
func RewriteStdout()
RewriteStdout rewrite os.Stdout Usage:
RewriteStdout() fmt.Println("Hello, playground") msg := RestoreStdout()
Types ¶
Click to show internal directories.
Click to hide internal directories.