INNER CODE UNIT · Go
graph
pcasteran/terraform-graph-beautifier · main.go:80
graph := graphviz.LoadGraph(inputFile, *keepTfJunk, excludePatterns)
// Write the result to the specified output.
outputFile := os.Stdout
if *outputFilePath != "" {
// Write to the specified file.
outputFile, err = os.Create(*outputFilePath)
if err != nil {
log.Fatal().Err(err).Msg("Cannot open the file for writing")
}
defer func() {
if err := outputFile.Close(); err != nil {
log.Fatal().Err(err).Msg("Cannot close the file after writing")
}
}()
}
switch *outputType {