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