Move logic to check if deviceinfo file exists to pkgs/deviceinfo (MR 37)
This is mostly a preparatory commit to later be able to read the deviceinfo from multiple places. It has a bit better encapsulation, and makes the functions methods, so that they can update deviceinfo file in-place.
This commit is contained in:
committed by
Clayton Craft
parent
b2cdfe9da4
commit
c87b926a53
@@ -58,7 +58,7 @@ func TestUnmarshal(t *testing.T) {
|
||||
var d DeviceInfo
|
||||
for _, table := range tables {
|
||||
testName := fmt.Sprintf("unmarshal::'%s':", strings.ReplaceAll(table.in, "\n", "\\n"))
|
||||
if err := unmarshal(strings.NewReader(table.in), &d); err != nil {
|
||||
if err := d.unmarshal(strings.NewReader(table.in)); err != nil {
|
||||
t.Errorf("%s received an unexpected err: ", err)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user