diff --git a/src/cli/edit.go b/src/cli/edit.go index 8711694..a4ae86f 100644 --- a/src/cli/edit.go +++ b/src/cli/edit.go @@ -130,7 +130,7 @@ func editNote(baseNote []string) ([]string, bool) { note = append(note, scanner.Text()) } - // close the tempFile + // close tempFile tempFile.Close() // return the edited note if it is different from baseNote diff --git a/src/cli/utilitiesMisc.go b/src/cli/utilitiesMisc.go index 59874dd..d240d65 100644 --- a/src/cli/utilitiesMisc.go +++ b/src/cli/utilitiesMisc.go @@ -22,7 +22,7 @@ func input(prompt string) string { fmt.Print("\n" + prompt + " ") reader := bufio.NewReader(os.Stdin) userInput, _ := reader.ReadString('\n') - return strings.TrimRight(userInput, "\n ") // remove trailing newlines and spaces + return strings.TrimRight(userInput, "\n\r ") // remove trailing newlines, carriage returns, and spaces } // inputHidden prompts the user for input and returns the input as a string, hiding the input from the terminal