Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix perfsprint linter error #1438

Closed
wants to merge 2 commits into from
Closed
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
3 changes: 2 additions & 1 deletion cmd/dashboard.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
"net"
"os"
"os/signal"
"strconv"

"github.com/pkg/browser"
"github.com/spf13/cobra"
Expand Down Expand Up @@ -180,7 +181,7 @@ dapr dashboard -k -p 0
}()

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

print.InfoStatusEvent(os.Stdout, fmt.Sprintf("Dapr dashboard found in namespace:\t%s", foundNamespace))
print.InfoStatusEvent(os.Stdout, fmt.Sprintf("Dapr dashboard available at:\t%s\n", webURL))
Expand Down
2 changes: 1 addition & 1 deletion pkg/standalone/invoke.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func (s *Standalone) Invoke(appID, method string, data []byte, verb string, path
}

func makeEndpoint(lo ListOutput, method string) string {
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
return fmt.Sprintf("http://127.0.0.1:%d/v%s/invoke/%s/method/%s", lo.HTTPPort, api.RuntimeAPIVersion, lo.AppID, method)
}

func handleResponse(response *http.Response) (string, error) {
Expand Down
2 changes: 1 addition & 1 deletion pkg/standalone/publish.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func (s *Standalone) Publish(publishAppID, pubsubName, topic string, payload []b
},
}
} else {
url = fmt.Sprintf("http://localhost:%s/v%s/publish/%s/%s%s", fmt.Sprintf("%v", instance.HTTPPort), api.RuntimeAPIVersion, pubsubName, topic, queryParams) //nolint: perfsprint
url = fmt.Sprintf("http://localhost:%d/v%s/publish/%s/%s%s", instance.HTTPPort, api.RuntimeAPIVersion, pubsubName, topic, queryParams)
}

contentType := "application/json"
Expand Down
5 changes: 3 additions & 2 deletions pkg/standalone/stop.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package standalone

import (
"fmt"
"strconv"
"syscall"

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

_, err := utils.RunCmdAndWait("kill", pid)
Expand Down
Loading