Fix specifying a message via file.

This commit is contained in:
Martin Dosch 2024-02-17 16:17:19 +01:00
parent 55e16b417d
commit b4613f5cf0
No known key found for this signature in database
GPG Key ID: 52A57CFCE13D657D
2 changed files with 4 additions and 3 deletions

View File

@ -3,6 +3,7 @@
## UNRELEASED
### Changed
- Use a human readable file name for private Ox keys.
- Fix specifying a message via command line flag `-m`.
## [v0.8.2] 2024-01-19
### Changed

View File

@ -50,7 +50,7 @@ func readMessage(messageFilePath string) (string, error) {
// Check that message file is existing.
_, err = os.Stat(messageFilePath)
if os.IsNotExist(err) {
if err != nil {
return output, fmt.Errorf("readMessage: %w", err)
}
@ -69,7 +69,7 @@ func readMessage(messageFilePath string) (string, error) {
}
}
if err := scanner.Err(); err != nil {
if err = scanner.Err(); err != nil {
if err != io.EOF {
return "", fmt.Errorf("readMessage: %w", err)
}
@ -80,7 +80,7 @@ func readMessage(messageFilePath string) (string, error) {
fmt.Println("error while closing file:", err)
}
return output, fmt.Errorf("readMessage: %w", err)
return output, nil
}
func main() {