MCPcopy Create free account
hub / github.com/devfile/api / readFileToStruct

Function readFileToStruct

pkg/utils/overriding/overriding_test.go:254–263  ·  view source on GitHub ↗
(t *testing.T, path string, into interface{})

Source from the content-addressed store, hash-verified

252}
253
254func readFileToStruct(t *testing.T, path string, into interface{}) {
255 bytes, err := ioutil.ReadFile(path)
256 if err != nil {
257 t.Fatalf("Failed to read test file from %s: %s", path, err.Error())
258 }
259 err = yaml.Unmarshal(bytes, into)
260 if err != nil {
261 t.Fatalf("Failed to unmarshal file into struct: %s", err.Error())
262 }
263}
264
265// Since order of error message lines is not deterministic, it's necessary to compare
266// in a weaker way than asserting string equality.

Callers 5

TestOverridingPatchesFunction · 0.70
TestPluginOverridesFunction · 0.70
TestMergingFunction · 0.70
TestMergingOnlyPluginsFunction · 0.70
TestMergingOnlyParentFunction · 0.70

Calls 1

ErrorMethod · 0.45

Tested by

no test coverage detected