File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -77,7 +77,7 @@ func main() {
7777 os .Exit (1 )
7878 }
7979
80- ctx := createContext (* t )
80+ ctx , _ := createContext (* t )
8181 err = conn .WriteQuery (ctx , query , * o , loggerFn )
8282 if err != nil {
8383 fmt .Println (err )
@@ -94,14 +94,14 @@ func readQueryFromFile(path string) (*sql2csv.Query, error) {
9494 return sql2csv .NewQuery (string (f ))
9595}
9696
97- func createContext (timeout int ) context.Context {
97+ func createContext (timeout int ) ( context.Context , context. CancelFunc ) {
9898 if timeout == 0 {
99- return context .Background ()
99+ return context .Background (), nil
100100 }
101101
102- c , _ := context .WithTimeout (context .Background (), time .Second * time .Duration (timeout ))
102+ c , cancel := context .WithTimeout (context .Background (), time .Second * time .Duration (timeout ))
103103
104- return c
104+ return c , cancel
105105}
106106
107107func verboseLog (logger * log.Logger , verbose bool , ln string ) {
You can’t perform that action at this time.
0 commit comments