Skip to content

Commit

Permalink
wsclient: remove named returns
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelkarp committed Jul 21, 2017
1 parent adcca2c commit d57d983
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions agent/wsclient/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -350,17 +350,18 @@ func (cs *ClientServerImpl) handleMessage(data []byte) {
}
}

func websocketScheme(httpScheme string) (wsScheme string, err error) {
func websocketScheme(httpScheme string) (string, error) {
// gorilla/websocket expects the websocket scheme (ws[s]://)
var wsScheme string
switch httpScheme {
case "http":
wsScheme = "ws"
case "https":
wsScheme = "wss"
default:
err = fmt.Errorf("wsclient: unknown scheme %s", httpScheme)
return "", fmt.Errorf("wsclient: unknown scheme %s", httpScheme)
}
return
return wsScheme, nil
}

// See https://github.com/gorilla/websocket/blob/87f6f6a22ebfbc3f89b9ccdc7fddd1b914c095f9/conn.go#L650
Expand Down

0 comments on commit d57d983

Please sign in to comment.