Documentation
¶
Index ¶
- func CopyDir(from, to string) error
- func CopyFile(from, to string) error
- func CreateDir(rootDir, dir string) error
- func CreateFile(rootDir, filePath string, content []byte) error
- func ReplaceStderr() (restore func(), getOutput func() string)
- func ReplaceStdout() (restore func(), getOutput func() string)
- type Request
- type TestClock
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateFile ¶
func ReplaceStderr ¶
func ReplaceStderr() (restore func(), getOutput func() string)
ReplaceStderr temporarily replaces os.Stderr with a buffer and captures the standard error in a string. Use `defer restore()` to restore the original os.Stderr. Call getOutput once done writing to standard error.
func ReplaceStdout ¶
func ReplaceStdout() (restore func(), getOutput func() string)
ReplaceStdout temporarily replaces os.Stdout with a buffer and captures the standard output in a string. Use `defer restore()` to restore the original os.Stdout. Call getOutput once done writing to standard output.
Types ¶
type Request ¶
type Request struct {
// contains filtered or unexported fields
}
func NewRequest ¶
func (*Request) RunOnHandler ¶
func (r *Request) RunOnHandler(h http.Handler) *httptest.ResponseRecorder
func (*Request) WithHeader ¶
Click to show internal directories.
Click to hide internal directories.