fix: shadowing original error

This fixes shadowing the original error so that the original error is
propagated upwards
This commit is contained in:
ALX99 2024-08-23 22:40:37 +09:00
parent 9a0444db7e
commit 7cbd49375a

View File

@ -56,7 +56,6 @@ func Init() (ret *Flags, err error) {
// takes input from stdin if it exists, otherwise takes input from args (the last argument) // takes input from stdin if it exists, otherwise takes input from args (the last argument)
if hasStdin { if hasStdin {
if message, err = readStdin(); err != nil { if message, err = readStdin(); err != nil {
err = errors.New("error: could not read from stdin")
return return
} }
} else if len(args) > 0 { } else if len(args) > 0 {