Skip to content

Instantly share code, notes, and snippets.

@kunalkushwaha
Created December 24, 2015 07:47
Show Gist options
  • Select an option

  • Save kunalkushwaha/6d2142e5e0cf1c365562 to your computer and use it in GitHub Desktop.

Select an option

Save kunalkushwaha/6d2142e5e0cf1c365562 to your computer and use it in GitHub Desktop.
dumpYAML
//FIXME: Debug function need to remove at final PR
func dumpYAMLConfig(filename string, document []machineConfig) {
fileToWrite, err := os.Create(filename)
if err != nil {
println("Failed to open file for writing:", err.Error())
}
encoder := yaml.NewEncoder(fileToWrite)
err = encoder.Encode(document)
if err != nil {
println("Failed to encode document:", err.Error())
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment