LoadInput: reduce variable scope (input, err)

Move input and err variable declarations to their usage point.
This commit is contained in:
Andy Kluger
2025-12-02 14:59:45 -05:00
parent 4debd29ccf
commit 70d9b64301

View File

@@ -159,8 +159,6 @@ func LoadInput(args []string) []*buffer.Buffer {
// should be opened
var filename string
var input []byte
var err error
buffers := make([]*buffer.Buffer, 0, len(args))
files := make([]string, 0, len(args))
@@ -235,7 +233,7 @@ func LoadInput(args []string) []*buffer.Buffer {
// Option 2
// The input is not a terminal, so something is being piped in
// and we should read from stdin
input, err = io.ReadAll(os.Stdin)
input, err := io.ReadAll(os.Stdin)
if err != nil {
screen.TermMessage("Error reading from stdin: ", err)
input = []byte{}