From ca5ba86952d23910a3530534ec08b5af00519f61 Mon Sep 17 00:00:00 2001 From: Andy Cobaugh Date: Fri, 1 Oct 2021 20:50:30 -0400 Subject: [PATCH] fix: fix usage of yaml.Unmarshal() --- main.go | 4 ++-- main_test.go | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 main_test.go diff --git a/main.go b/main.go index 3717cff..f0aeda4 100644 --- a/main.go +++ b/main.go @@ -96,7 +96,7 @@ func processMetaData(configDriveDir string) error { } var md MetaData - err = yaml.Unmarshal(metaData, md) + err = yaml.Unmarshal(metaData, &md) if err != nil { return fmt.Errorf("could not parse meta-data file as YAML: %s", err) } @@ -123,7 +123,7 @@ func processUserData(configDriveDir string) error { } var cc CloudConfig - err = yaml.Unmarshal(userData, cc) + err = yaml.Unmarshal(userData, &cc) if err != nil { return fmt.Errorf("could not parse user-data file as YAML: %s", err) } diff --git a/main_test.go b/main_test.go new file mode 100644 index 0000000..fe557b5 --- /dev/null +++ b/main_test.go @@ -0,0 +1,8 @@ +package main + +import "testing" + +func TestProcessMetaData(T *testing.T) { + + _ = processMetaData("test") +}