1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
package main import ( "bytes" _ "embed" "testing" "github.com/stretchr/testify/assert" ) //go:embed config_example.yaml var cfg []byte func TestConfig(t *testing.T) { _, err := loadConfig(bytes.NewReader(cfg)) assert.NoError(t, err) }