How would you write a test for the below function to get 100% coverage?
func countLines(files []string) int {
sum := 0
for _, e := range files {
f, err := os.Open(e)
if err != nil {
fmt.Fprintf(os.Stderr, "err: %v
", err)
continue
}
sum += countFileLine(f)
f.Close()
}
return sum
}