Documentation
¶
Index ¶
- func AnalyzeTimeConsumed() func()
- func AssertEqual(t *testing.T, actual any, expected any)
- func AssertNot(t *testing.T, actual any, expected any)
- func CaptureStdout(fn func()) string
- func ErrorMsg(format string, a ...any)
- func Fail(t *testing.T, actual any, expected any)
- func StartCPUProfile() func()
- func StartMemoryProfile() func()
- func StartTrace() func()
- func TimeIt(fn func())
- func WithTimeoutCtxMilliSeconds(milliSeconds int) (context.Context, context.CancelFunc)
- func WithTimeoutCtxSeconds(seconds int) (context.Context, context.CancelFunc)
- type Set
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AnalyzeTimeConsumed ¶ added in v0.1.5
func AnalyzeTimeConsumed() func()
AnalyzeTimeConsumed is a function that returns a function that can be used to analyze the time consumed. Usage: defer AnalyzeTimeConsumed()()
func CaptureStdout ¶ added in v0.1.5
func CaptureStdout(fn func()) string
CaptureStdout captures the output of a function that writes to stdout and returns the output content as a string
func StartCPUProfile ¶
func StartCPUProfile() func()
You can view the cpu profile file with `go tool pprof codetalks-cpu.prof` or visualize it on website like https://www.speedscope.app/
func StartMemoryProfile ¶
func StartMemoryProfile() func()
You can view the memory profile file with `go tool pprof codetalks-mem.prof` or visualize it on website like https://www.speedscope.app/
func StartTrace ¶
func StartTrace() func()
You can view the trace file with `go tool trace codetalks-trace.prof`
func WithTimeoutCtxMilliSeconds ¶ added in v0.1.6
func WithTimeoutCtxMilliSeconds(milliSeconds int) (context.Context, context.CancelFunc)
func WithTimeoutCtxSeconds ¶ added in v0.1.6
func WithTimeoutCtxSeconds(seconds int) (context.Context, context.CancelFunc)
Types ¶
type Set ¶
type Set struct {
// contains filtered or unexported fields
}
Define a set as a map with keys of type string and values of type void