mirror of
https://github.com/github/codeql.git
synced 2026-02-22 18:03:39 +01:00
19 lines
256 B
Go
19 lines
256 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
)
|
|
|
|
func user(input string) {
|
|
|
|
ptr, err := os.Open(input)
|
|
if err != nil {
|
|
fmt.Printf("Bad input: %s\n", input)
|
|
return
|
|
}
|
|
// GOOD: `err` has been checked before `ptr` is used
|
|
fmt.Printf("Result was %v\n", *ptr)
|
|
|
|
}
|