mirror of
https://github.com/github/codeql.git
synced 2025-12-18 18:10:39 +01:00
19 lines
275 B
Go
19 lines
275 B
Go
package main
|
|
|
|
import "os"
|
|
|
|
func openFile(filename string) {
|
|
file, err := os.Open(filename)
|
|
defer file.Close()
|
|
if err != nil {
|
|
// handle error
|
|
}
|
|
// work on file
|
|
}
|
|
|
|
func openFilesGood(filenames []string) {
|
|
for _, filename := range filenames {
|
|
openFile(filename)
|
|
}
|
|
}
|