Documentation ¶
Overview ¶
Package fakefill contains code to fill structs for testing.
This package is quite limited in scope and we can fill only the structures you typically send over as JSONs.
As part of future work, we aim to investigate whether we can replace this implementation with https://go.dev/blog/fuzz-beta.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Filler ¶
type Filler struct { // Now is OPTIONAL and allows to mock the current time Now func() time.Time // contains filtered or unexported fields }
Filler fills specific data structures with random data. The only exception to this behaviour is time.Time, which is instead filled with the current time plus a small random number of seconds.
We use this implementation to initialize data in our model. The code has been written with that in mind. It will require some hammering in case we extend the model with new field types.
Caveat: this kind of fillter does not support filling interfaces and channels and other complex types. The current behavior when this kind of data types is encountered is to just ignore them.