INNER CODE UNIT · Go
err
pcasteran/terraform-graph-beautifier · main.go:70
inputFile, err = os.Open(*inputFilePath)
if err != nil {
log.Fatal().Err(err).Msg("Cannot open the file for reading")
}
defer func() {
if err := inputFile.Close(); err != nil {
log.Fatal().Err(err).Msg("Cannot close the file after reading")
}
}()
}
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 {