Skip to content

Commit

Permalink
fix: fix usage of yaml.Unmarshal()
Browse files Browse the repository at this point in the history
  • Loading branch information
acobaugh committed Oct 2, 2021
1 parent e2307d8 commit ca5ba86
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand All @@ -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)
}
Expand Down
8 changes: 8 additions & 0 deletions main_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package main

import "testing"

func TestProcessMetaData(T *testing.T) {

_ = processMetaData("test")
}

0 comments on commit ca5ba86

Please sign in to comment.