Created
April 29, 2014 11:17
-
-
Save phihag/11397245 to your computer and use it in GitHub Desktop.
Demo file for file handle count question on so
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "fmt" | |
import "io/ioutil" | |
func main() { | |
files, _ := ioutil.ReadDir("/tmp/files") | |
for _, file := range files { | |
_, err := ioutil.ReadFile("/tmp/files/" + file.Name()) | |
if err != nil { | |
fmt.Printf("[ERROR/IO]: %s | %s\n", file.Name(), err) | |
panic("failed") | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment