mocktime

command
v0.0.0-...-141b564 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 31, 2022 License: MIT Imports: 3 Imported by: 0

README

Altered Logger

This example shows that in a different dimension you can alter time.Now(). This is a very basic approach, but a more robust time mocking solution can be built like this.

Compiling

To compile, first the compiler tool must be compiled. From the root of the repo, run:

go build ./example/mocktime/superpose-mocktime

Now it can be executed as toolexec, for example:

go run -toolexec /path/to/superpose-mocktime ./example/mocktime

Note how the log statement in the mocked environment shows whatever time we set.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL