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

Possibly broken usages of Sprintf #75

Open
xelxebar opened this issue Aug 21, 2023 · 0 comments
Open

Possibly broken usages of Sprintf #75

xelxebar opened this issue Aug 21, 2023 · 0 comments

Comments

@xelxebar
Copy link

Overview

The following warnings show up in my editor's linter:

$ go test
# github.com/elisescu/tty-share
./client.go:197:14: github.com/sirupsen/logrus.Warnf call has arguments but no formatting directives
./client.go:203:14: github.com/sirupsen/logrus.Warnf call has arguments but no formatting directives
./main.go:159:14: fmt.Sprintf call has arguments but no formatting directives

Patch

Is the intention something like this:

diff --git a/client.go b/client.go
index 61f278d..a78546f 100644
--- a/client.go
+++ b/client.go
@@ -194,13 +194,13 @@ func (c *ttyShareClient) Run() (err error) {
 			localTunconn, err := localListener.Accept()
 
 			if err != nil {
-				log.Warnf("Cannot accept local tunnel connections: ", err.Error())
+				log.Warnf("Cannot accept local tunnel connections: %s", err.Error())
 				return
 			}
 
 			muxClient, err := c.tunnelMuxSession.Open()
 			if err != nil {
-				log.Warnf("Cannot create a muxer to the remote, over ws: ", err.Error())
+				log.Warnf("Cannot create a muxer to the remote, over ws: %s", err.Error())
 				return
 			}
 
diff --git a/main.go b/main.go
index c8715a4..c092c46 100644
--- a/main.go
+++ b/main.go
@@ -156,7 +156,7 @@ Flags:
 	envVars := os.Environ()
 	envVars = append(envVars,
 		fmt.Sprintf("TTY_SHARE_LOCAL_URL=http://%s", *listenAddress),
-		fmt.Sprintf("TTY_SHARE=1", os.Getpid()),
+		fmt.Sprintf("TTY_SHARE=1"),
 	)
 
 	if publicURL != "" {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant