diff --git a/safesql.go b/safesql.go index f26d65c..adf8bb8 100644 --- a/safesql.go +++ b/safesql.go @@ -65,6 +65,11 @@ func main() { } p, err := c.Load() + if err != nil { + fmt.Printf("error loading packages %v: %v\n", pkgs, err) + os.Exit(2) + } + imports := getImports(p) existOne := false for i := range sqlPackages { @@ -81,11 +86,6 @@ func main() { os.Exit(2) } - if err != nil { - fmt.Printf("error loading packages %v: %v\n", pkgs, err) - os.Exit(2) - } - s := ssautil.CreateProgram(p, 0) s.Build()