Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions util/printer.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ var (
)

// GetRawInfo do what its name tells
// nolint:unused
func GetRawInfo(app string) string {
info := ""
info += fmt.Sprintf("App Name: %s\n", app)
Expand All @@ -43,6 +44,7 @@ func GetRawInfo(app string) string {
}

// PrintInfo prints the app's basic information in log
// nolint:unused
func PrintInfo(app string) {
log.Info("Welcome to "+app,
zap.String("Release Version", Version),
Expand Down
8 changes: 5 additions & 3 deletions util/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"io"
"net"
"net/http"
"strconv"
Expand Down Expand Up @@ -63,6 +63,8 @@ func StringsToInterfaces(strs []string) []interface{} {
// return errors.Trace(err)
// }
// fmt.Println(resp.IP)
//
// nolint:unused
func GetJSON(client *http.Client, url string, v interface{}) error {
resp, err := client.Get(url)
if err != nil {
Expand All @@ -71,7 +73,7 @@ func GetJSON(client *http.Client, url string, v interface{}) error {
defer resp.Body.Close()

if resp.StatusCode != http.StatusOK {
body, err := ioutil.ReadAll(resp.Body)
body, err := io.ReadAll(resp.Body)
if err != nil {
return errors.Trace(err)
}
Expand Down Expand Up @@ -181,7 +183,7 @@ func GenLogFields(costTime time.Duration, info *ProcessInfo, needTruncateSQL boo
// PrintableASCII detects if b is a printable ASCII character.
// Ref to:http://facweb.cs.depaul.edu/sjost/it212/documents/ascii-pr.htm
func PrintableASCII(b byte) bool {
if b >= 0 && b < 32 || b > 127 {
if b < 32 || b > 127 {
return false
}

Expand Down