Documentation
¶
Overview ¶
Package common provides helpers for writing tests.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MakeSlice ¶
MakeSlice creates a new slice in place.
Useful for initializing slices of anonymous structs in tests.
type Config struct {
Endpoints []struct {
Host string
Port uint
}
}
var cfg Config
MakeSlice(&cfg.Endpoints, 10)
func NewViper ¶
NewViper creates a new viper.Viper instance configured for testing.
func RunForEachSource ¶
RunForEachSource runs a test for each config source: YAML, JSON, and ENV.
Types ¶
type LogDestination ¶
LogDestination is a custom type that implements core.ConfigLoader.
func (*LogDestination) Load ¶
Load implements core.ConfigLoader.
Click to show internal directories.
Click to hide internal directories.