Skip to content

Commit 70d9b64

Browse files
committed
LoadInput: reduce variable scope (input, err)
Move input and err variable declarations to their usage point.
1 parent 4debd29 commit 70d9b64

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

cmd/micro/micro.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,6 @@ func LoadInput(args []string) []*buffer.Buffer {
159159
// should be opened
160160

161161
var filename string
162-
var input []byte
163-
var err error
164162
buffers := make([]*buffer.Buffer, 0, len(args))
165163

166164
files := make([]string, 0, len(args))
@@ -235,7 +233,7 @@ func LoadInput(args []string) []*buffer.Buffer {
235233
// Option 2
236234
// The input is not a terminal, so something is being piped in
237235
// and we should read from stdin
238-
input, err = io.ReadAll(os.Stdin)
236+
input, err := io.ReadAll(os.Stdin)
239237
if err != nil {
240238
screen.TermMessage("Error reading from stdin: ", err)
241239
input = []byte{}

0 commit comments

Comments
 (0)