Merge pull request #48871 from wanghaoran1988/do_not_close_stdin

Automatic merge from submit-queue (batch tested with PRs 48914, 48535, 49099, 48935, 48871)

do not close os.Stdin manually

**What this PR does / why we need it**:
We don't need close os.Stdin manually, it will block our read from stdin after finish the visit.
**Special notes for your reviewer**:

**Release note**:
```
None
```
This commit is contained in:
Kubernetes Submit Queue 2017-07-18 21:04:28 -07:00 committed by GitHub
commit 32580b89b1

View File

@ -487,11 +487,12 @@ func (v *FileVisitor) Visit(fn VisitorFunc) error {
f = os.Stdin
} else {
var err error
if f, err = os.Open(v.Path); err != nil {
f, err = os.Open(v.Path)
if err != nil {
return err
}
}
defer f.Close()
}
// TODO: Consider adding a flag to force to UTF16, apparently some
// Windows tools don't write the BOM