Skip to content

Possibly broken usages of Sprintf #75

@xelxebar

Description

@xelxebar

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 != "" {

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions