mirror of
https://github.com/kataras/iris.git
synced 2025-01-23 18:51:03 +01:00
recover on ssh help message(template), (-) this happens if server machine has an old version of golang
This commit is contained in:
parent
8bd94875d2
commit
0dffe0dfa9
8
ssh.go
8
ssh.go
|
@ -486,7 +486,13 @@ var standardCommands = Commands{Command{Name: "help", Description: "Opens up the
|
||||||
func (s *SSHServer) writeHelp(wr io.Writer) {
|
func (s *SSHServer) writeHelp(wr io.Writer) {
|
||||||
port := parsePort(s.Host)
|
port := parsePort(s.Host)
|
||||||
hostname := parseHostname(s.Host)
|
hostname := parseHostname(s.Host)
|
||||||
|
defer func() {
|
||||||
|
if r := recover(); r != nil {
|
||||||
|
// means that user-dev has old version of Go Programming Language in her/his machine, so print a message to the server terminal
|
||||||
|
// which will help the dev, NOT the client
|
||||||
|
s.logf("[IRIS SSH] Help message is disabled, please install Go Programming Language, at least version 1.7: https://golang.org/dl/")
|
||||||
|
}
|
||||||
|
}()
|
||||||
data := map[string]interface{}{
|
data := map[string]interface{}{
|
||||||
"Hostname": hostname, "PortDeclaration": "-p " + strconv.Itoa(port),
|
"Hostname": hostname, "PortDeclaration": "-p " + strconv.Itoa(port),
|
||||||
"Commands": append(s.Commands, standardCommands...),
|
"Commands": append(s.Commands, standardCommands...),
|
||||||
|
|
Loading…
Reference in New Issue
Block a user