File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2,8 +2,8 @@ package main
22
33import (
44 "fmt"
5- "io/ioutil"
65 "log"
6+ "os"
77 "sync"
88
99 "gopkg.in/yaml.v2"
2929)
3030
3131func loadConfig (path string ) error {
32- file , err := ioutil .ReadFile (path )
32+ file , err := os .ReadFile (path )
3333 if err != nil {
3434 return fmt .Errorf ("failed to read config: %w" , err )
3535 }
Original file line number Diff line number Diff line change @@ -16,16 +16,16 @@ import (
1616)
1717
1818func sanitizeQueryStr (queryString string ) string {
19- sanitizedQueryStr := strings .Replace (queryString , "\n " , " " , - 1 )
20- sanitizedQueryStr = strings .Replace (sanitizedQueryStr , "\r " , "" , - 1 )
19+ sanitizedQueryStr := strings .ReplaceAll (queryString , "\n " , " " )
20+ sanitizedQueryStr = strings .ReplaceAll (sanitizedQueryStr , "\r " , "" )
2121 return sanitizedQueryStr
2222}
2323
2424func generateErrorQuery (msg string ) string {
2525 // return a query that triggers an error on the server that contains our
2626 // desired error message
27- escapedMsg := strings .Replace (msg , "'" , "''" , - 1 )
28- escapedMsg = strings .Replace (escapedMsg , `\` , `\\` , - 1 )
27+ escapedMsg := strings .ReplaceAll (msg , "'" , "''" )
28+ escapedMsg = strings .ReplaceAll (escapedMsg , `\` , `\\` )
2929 return fmt .Sprintf ("'%s';" , escapedMsg )
3030}
3131
You can’t perform that action at this time.
0 commit comments