Documentation
¶
Overview ¶
Package encodertest provides test helpers for testing package encoder
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IgnoreAllUnexported ¶
IgnoreAllUnexported returns an Option that only ignores the all unexported fields of a struct and its descendents, including anonymous fields of unexported types,
func PopulateRandom ¶
func PopulateRandom(obj interface{}, rand *mathrand.Rand, options PopulateRandomOptions) error
PopulateRandom constructs an object with random data. This is used by the autogenerated skyencoder tests and can be useful in other testing.
Types ¶
type PopulateRandomOptions ¶
type PopulateRandomOptions struct {
// Maximum random length for strings, slices, maps. If a string, slice or map has a `maxlen` struct tag, the lesser of the two will be used
MaxRandLen int
// Minimum random length for strings, slices, maps
MinRandLen int
// Leave slices as nil if they are empty
EmptySliceNil bool
// Leaves maps as nil if they are empty
EmptyMapNil bool
// Leave an omitempty field empty
ForceEmptyOmitEmpty bool
// Don't populate maps
IgnoreMaps bool
}
PopulateRandomOptions are configuration options for the PopulateRandom method
Click to show internal directories.
Click to hide internal directories.