|
|
|
@ -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() {
|
|
|
|
|