Test: No production impact, unit tests included, actively testing current production dataset Change-Id: Ia7835938d602f3a11e0d001a1242a8278960b096
15 lines
246 B
Go
15 lines
246 B
Go
package filesystem
|
|
|
|
import (
|
|
"encoding/xml"
|
|
"io/ioutil"
|
|
)
|
|
|
|
func ReadXMLAsEntity(filePath string, entity interface{}) error {
|
|
xmlBytes, err := ioutil.ReadFile(filePath)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
return xml.Unmarshal(xmlBytes, entity)
|
|
}
|