mirror of
https://salsa.debian.org/mdosch/go-sendxmpp
synced 2024-11-18 21:25:31 +00:00
Fix specifying a message via file.
This commit is contained in:
parent
55e16b417d
commit
b4613f5cf0
@ -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
|
||||
|
6
main.go
6
main.go
@ -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() {
|
||||
|
Loading…
Reference in New Issue
Block a user