Skip to content

Commit 15ee4ed

Browse files
committed
Fix linter warnings
1 parent 3ad3c7a commit 15ee4ed

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

config.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ package main
22

33
import (
44
"fmt"
5-
"io/ioutil"
65
"log"
6+
"os"
77
"sync"
88

99
"gopkg.in/yaml.v2"
@@ -29,7 +29,7 @@ var (
2929
)
3030

3131
func 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
}

main.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,16 @@ import (
1616
)
1717

1818
func 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

2424
func 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

0 commit comments

Comments
 (0)