mirror of
https://github.com/github/codeql.git
synced 2026-06-14 17:31:09 +02:00
15 lines
256 B
Go
15 lines
256 B
Go
package main
|
|
|
|
import "os"
|
|
|
|
func openFiles(filenames []string) {
|
|
for _, filename := range filenames {
|
|
file, err := os.Open(filename)
|
|
defer file.Close() // $ Alert[go/examples/deferinloop]
|
|
if err != nil {
|
|
// handle error
|
|
}
|
|
// work on file
|
|
}
|
|
}
|