From 70d9b643016270f7a5bb5e9f680296c8c1fb7d1c Mon Sep 17 00:00:00 2001 From: Andy Kluger Date: Tue, 2 Dec 2025 14:59:45 -0500 Subject: [PATCH] LoadInput: reduce variable scope (input, err) Move input and err variable declarations to their usage point. --- cmd/micro/micro.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/cmd/micro/micro.go b/cmd/micro/micro.go index 8e5e500a..8631fe5d 100644 --- a/cmd/micro/micro.go +++ b/cmd/micro/micro.go @@ -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{}