Skip to content

Commit 22536a9

Browse files
authored
Merge pull request #1438 from KentHsu/fix-perfsprint-linter-error
fix perfsprint linter error
2 parents b51eab0 + fff4c91 commit 22536a9

File tree

4 files changed

+7
-5
lines changed

4 files changed

+7
-5
lines changed

cmd/dashboard.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import (
1818
"net"
1919
"os"
2020
"os/signal"
21+
"strconv"
2122

2223
"github.com/pkg/browser"
2324
"github.com/spf13/cobra"
@@ -180,7 +181,7 @@ dapr dashboard -k -p 0
180181
}()
181182

182183
// url for dashboard after port forwarding.
183-
webURL := fmt.Sprintf("http://%s", net.JoinHostPort(dashboardHost, fmt.Sprint(portForward.LocalPort))) //nolint: perfsprint
184+
webURL := "http://" + net.JoinHostPort(dashboardHost, strconv.Itoa(portForward.LocalPort))
184185

185186
print.InfoStatusEvent(os.Stdout, "Dapr dashboard found in namespace:\t"+foundNamespace)
186187
print.InfoStatusEvent(os.Stdout, fmt.Sprintf("Dapr dashboard available at:\t%s\n", webURL))

pkg/standalone/invoke.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ func (s *Standalone) Invoke(appID, method string, data []byte, verb string, path
6464
}
6565

6666
func makeEndpoint(lo ListOutput, method string) string {
67-
return fmt.Sprintf("http://127.0.0.1:%s/v%s/invoke/%s/method/%s", fmt.Sprintf("%v", lo.HTTPPort), api.RuntimeAPIVersion, lo.AppID, method) //nolint: perfsprint
67+
return fmt.Sprintf("http://127.0.0.1:%d/v%s/invoke/%s/method/%s", lo.HTTPPort, api.RuntimeAPIVersion, lo.AppID, method)
6868
}
6969

7070
func handleResponse(response *http.Response) (string, error) {

pkg/standalone/publish.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ func (s *Standalone) Publish(publishAppID, pubsubName, topic string, payload []b
6262
},
6363
}
6464
} else {
65-
url = fmt.Sprintf("http://localhost:%s/v%s/publish/%s/%s%s", fmt.Sprintf("%v", instance.HTTPPort), api.RuntimeAPIVersion, pubsubName, topic, queryParams) //nolint: perfsprint
65+
url = fmt.Sprintf("http://localhost:%d/v%s/publish/%s/%s%s", instance.HTTPPort, api.RuntimeAPIVersion, pubsubName, topic, queryParams)
6666
}
6767

6868
contentType := "application/json"

pkg/standalone/stop.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ package standalone
1818

1919
import (
2020
"fmt"
21+
"strconv"
2122
"syscall"
2223

2324
"github.com/dapr/cli/utils"
@@ -31,10 +32,10 @@ func Stop(appID string, cliPIDToNoOfApps map[int]int, apps []ListOutput) error {
3132
// Kill the Daprd process if Daprd was started without CLI, otherwise
3233
// kill the CLI process which also kills the associated Daprd process.
3334
if a.CliPID == 0 || cliPIDToNoOfApps[a.CliPID] > 1 {
34-
pid = fmt.Sprintf("%v", a.DaprdPID) //nolint: perfsprint
35+
pid = strconv.Itoa(a.DaprdPID)
3536
cliPIDToNoOfApps[a.CliPID]--
3637
} else {
37-
pid = fmt.Sprintf("%v", a.CliPID) //nolint: perfsprint
38+
pid = strconv.Itoa(a.CliPID)
3839
}
3940

4041
_, err := utils.RunCmdAndWait("kill", pid)

0 commit comments

Comments
 (0)