From 2f2394df9b54255cf89d1e066d58ad44e2e5376c Mon Sep 17 00:00:00 2001 From: guoguangwu Date: Wed, 24 Apr 2024 17:15:22 +0800 Subject: [PATCH] chore: unnecessary use of fmt.Sprintf Signed-off-by: guoguangwu --- modules/nodata/config/service/mockcfg.go | 2 +- modules/transfer/http/debug_http.go | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/nodata/config/service/mockcfg.go b/modules/nodata/config/service/mockcfg.go index 86c288d01..3b05e1aa7 100644 --- a/modules/nodata/config/service/mockcfg.go +++ b/modules/nodata/config/service/mockcfg.go @@ -45,7 +45,7 @@ func GetMockCfgFromDB() map[string]*cmodel.NodataConfig { return ret } - q := fmt.Sprintf("SELECT id,name,obj,obj_type,metric,tags,dstype,step,mock FROM mockcfg") + q := "SELECT id,name,obj,obj_type,metric,tags,dstype,step,mock FROM mockcfg" rows, err := dbConn.Query(q) if err != nil { log.Println("db.query error, mockcfg", err) diff --git a/modules/transfer/http/debug_http.go b/modules/transfer/http/debug_http.go index 18316ea10..5967c2645 100644 --- a/modules/transfer/http/debug_http.go +++ b/modules/transfer/http/debug_http.go @@ -15,10 +15,10 @@ package http import ( - "fmt" - "github.com/open-falcon/falcon-plus/modules/transfer/sender" "net/http" "strings" + + "github.com/open-falcon/falcon-plus/modules/transfer/sender" ) func configDebugHttpRoutes() { @@ -29,7 +29,7 @@ func configDebugHttpRoutes() { argsLen := len(args) if argsLen < 1 { - w.Write([]byte(fmt.Sprintf("bad args\n"))) + w.Write([]byte("bad args\n")) return } @@ -41,7 +41,7 @@ func configDebugHttpRoutes() { case "graph": result = strings.Join(sender.GraphConnPools.Proc(), "\n") default: - result = fmt.Sprintf("bad args, module not exist\n") + result = "bad args, module not exist\n" } w.Write([]byte(result)) })