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

Function readFileToStruct

pkg/validation/variables/variables_test.go:176–185  ·  view source on GitHub ↗
(t *testing.T, path string, into interface{})

Source from the content-addressed store, hash-verified

174}
175
176func readFileToStruct(t *testing.T, path string, into interface{}) {
177 bytes, err := ioutil.ReadFile(path)
178 if err != nil {
179 t.Fatalf("Failed to read test file from %s: %s", path, err.Error())
180 }
181 err = yaml.Unmarshal(bytes, into)
182 if err != nil {
183 t.Fatalf("Failed to unmarshal file into struct: %s", err.Error())
184 }
185}

Calls 1

ErrorMethod · 0.45

Tested by

no test coverage detected