go-cat2 improve args loop
This commit is contained in:
parent
0433c6344c
commit
d4ce506f26
@ -43,8 +43,8 @@ func main() {
|
||||
reader = strings.NewReader(content)
|
||||
} else {
|
||||
readers := []io.Reader{}
|
||||
for i := 1; i < len(os.Args); i++ {
|
||||
f := openFile(&os.Args[i])
|
||||
for _, fname := range os.Args[1:] {
|
||||
f := openFile(&fname)
|
||||
defer f.Close()
|
||||
readers = append(readers, f)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user