Skip to content

Commit

Permalink
Add doc comments
Browse files Browse the repository at this point in the history
  • Loading branch information
briancain committed Nov 27, 2023
1 parent 30c1ab0 commit d49a484
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,17 @@ var rootCmd = &cobra.Command{
os.Exit(1)
}

// Run the editor
// Run the editor to get the edited contents
edited, _, err := Run(contents, filePathToEdit)
if err != nil {
fmt.Println("File editing error: ", err)
os.Exit(1)
}

// TODO(briancain): This is where you can run your parsers and validators
// on the edited text so you can show any parse or lint errors prior to
// saving the file

// If changes, overwrite the existing file
// Open the file for writing, creating it if it doesn't exist
file, err := os.OpenFile(filePathToEdit, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0644)
Expand Down

0 comments on commit d49a484

Please sign in to comment.