File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -77,7 +77,7 @@ func main() {
77
77
os .Exit (1 )
78
78
}
79
79
80
- ctx := createContext (* t )
80
+ ctx , _ := createContext (* t )
81
81
err = conn .WriteQuery (ctx , query , * o , loggerFn )
82
82
if err != nil {
83
83
fmt .Println (err )
@@ -94,14 +94,14 @@ func readQueryFromFile(path string) (*sql2csv.Query, error) {
94
94
return sql2csv .NewQuery (string (f ))
95
95
}
96
96
97
- func createContext (timeout int ) context.Context {
97
+ func createContext (timeout int ) ( context.Context , context. CancelFunc ) {
98
98
if timeout == 0 {
99
- return context .Background ()
99
+ return context .Background (), nil
100
100
}
101
101
102
- c , _ := context .WithTimeout (context .Background (), time .Second * time .Duration (timeout ))
102
+ c , cancel := context .WithTimeout (context .Background (), time .Second * time .Duration (timeout ))
103
103
104
- return c
104
+ return c , cancel
105
105
}
106
106
107
107
func verboseLog (logger * log.Logger , verbose bool , ln string ) {
You can’t perform that action at this time.
0 commit comments