Skip to content

Commit fc4ae63

Browse files
committed
Replace '%s' with %q
1 parent e6ae66c commit fc4ae63

File tree

16 files changed

+21
-21
lines changed

16 files changed

+21
-21
lines changed

cmd/server/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ func main() {
132132
if timeoutString, err := options.GetArgString("timeout"); err == nil {
133133
timeout, err = strconv.Atoi(timeoutString)
134134
if err != nil {
135-
fmt.Printf("Unable to convert '%s' to int\n", timeoutString)
135+
fmt.Printf("Unable to convert %q to int\n", timeoutString)
136136
printHelp()
137137
return
138138
}

internal/client/client.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -401,10 +401,10 @@ func Run(settings *Settings) {
401401
if err != nil {
402402

403403
if errMsg := err.Error(); strings.Contains(errMsg, "missing port in address") {
404-
log.Fatalf("Unable to connect to TCP invalid address: '%s', %s", settings.Addr, errMsg)
404+
log.Fatalf("Unable to connect to TCP invalid address: %q, %s", settings.Addr, errMsg)
405405
}
406406

407-
log.Printf("Unable to connect directly TCP: %s\n", err)
407+
log.Printf("Unable to connect directly TCP: %v\n", err)
408408

409409
if len(potentialProxies) > 0 {
410410
if len(potentialProxies) <= triedProxyIndex {

internal/client/handlers/session.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ func Session(session *connection.Session) func(newChannel ssh.NewChannel, log lo
5757
err := subsystems.RunSubsystems(connection, req)
5858
if err != nil {
5959
log.Error("subsystem encountered an error: %s", err.Error())
60-
fmt.Fprintf(connection, "subsystem error: '%s'", err.Error())
60+
fmt.Fprintf(connection, "subsystem error: %q", err.Error())
6161
}
6262

6363
return

internal/client/handlers/subsystems/init.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,5 @@ func RunSubsystems(connection ssh.Channel, req *ssh.Request) error {
3030
}
3131

3232
req.Reply(false, []byte("Unknown subsystem"))
33-
return fmt.Errorf("Unknown subsystem '%s'", req.Payload)
33+
return fmt.Errorf("Unknown subsystem %q", req.Payload)
3434
}

internal/global.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ func DiscardChannels(sshConn ssh.Conn, chans <-chan ssh.NewChannel) {
126126
t := newChannel.ChannelType()
127127

128128
newChannel.Reject(ssh.UnknownChannelType, fmt.Sprintf("unsupported channel type: %s", t))
129-
log.Printf("Client %s (%s) sent invalid channel type '%s'\n", sshConn.RemoteAddr(), sshConn.ClientVersion(), t)
129+
log.Printf("Client %s (%s) sent invalid channel type %q\n", sshConn.RemoteAddr(), sshConn.ClientVersion(), t)
130130
}
131131

132132
}

internal/server/commands/access.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ func (s *access) Run(user *users.User, tty io.ReadWriter, line terminal.ParsedLi
5959
}
6060

6161
if len(connections) == 0 {
62-
return fmt.Errorf("No clients matched '%s'", pattern)
62+
return fmt.Errorf("No clients matched %q", pattern)
6363
}
6464

6565
if !line.IsSet("y") {

internal/server/commands/connect.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,11 @@ func (c *connect) Run(user *users.User, tty io.ReadWriter, line terminal.ParsedL
5757
}
5858

5959
if len(foundClients) == 0 {
60-
return fmt.Errorf("No clients matched '%s'", client)
60+
return fmt.Errorf("No clients matched %q", client)
6161
}
6262

6363
if len(foundClients) > 1 {
64-
return fmt.Errorf("'%s' matches multiple clients please choose a more specific identifier", client)
64+
return fmt.Errorf("%q matches multiple clients please choose a more specific identifier", client)
6565
}
6666

6767
var target ssh.Conn

internal/server/commands/kill.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ func (k *kill) Run(user *users.User, tty io.ReadWriter, line terminal.ParsedLine
3131
}
3232

3333
if len(connections) == 0 {
34-
return fmt.Errorf("No clients matched '%s'", line.Arguments[0].Value())
34+
return fmt.Errorf("No clients matched %q", line.Arguments[0].Value())
3535
}
3636

3737
if !line.IsSet("y") {

internal/server/commands/listen.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ func (l *listen) client(user *users.User, tty io.ReadWriter, line terminal.Parse
8686
}
8787

8888
if len(foundClients) == 0 && !auto {
89-
return fmt.Errorf("No clients matched '%s'", specifier)
89+
return fmt.Errorf("No clients matched %q", specifier)
9090
}
9191

9292
if line.IsSet("l") {

internal/server/data/webhooks.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ func CreateWebhook(newUrl string, checktls bool) (string, error) {
2727

2828
addresses, err := net.LookupIP(u.Hostname())
2929
if err != nil {
30-
return "", fmt.Errorf("unable to lookup hostname '%s': %s", u.Hostname(), err)
30+
return "", fmt.Errorf("unable to lookup hostname %q: %s", u.Hostname(), err)
3131
}
3232

3333
if len(addresses) == 0 {
34-
return "", fmt.Errorf("no addresses found for '%s': %s", u.Hostname(), err)
34+
return "", fmt.Errorf("no addresses found for %q: %s", u.Hostname(), err)
3535
}
3636

3737
// Create a new Webhook instance

0 commit comments

Comments
 (0)