Merge branch 'main' into add_dry_run

This commit is contained in:
Azwar Tamim
2024-09-01 13:53:38 +07:00
committed by GitHub
10 changed files with 20 additions and 21 deletions

View File

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

View File

@@ -3,7 +3,6 @@ package cli
import (
"bytes"
"io"
"io/ioutil"
"os"
"strings"
"testing"
@@ -26,7 +25,7 @@ func TestInit(t *testing.T) {
func TestReadStdin(t *testing.T) {
input := "test input"
stdin := ioutil.NopCloser(strings.NewReader(input))
stdin := io.NopCloser(strings.NewReader(input))
// No need to cast stdin to *os.File, pass it as io.ReadCloser directly
content, err := ReadStdin(stdin)
if err != nil {