From 0dffe0dfa9a48ac00a1054d4007d9f06feda8902 Mon Sep 17 00:00:00 2001 From: Gerasimos Maropoulos Date: Thu, 15 Sep 2016 19:38:00 +0300 Subject: [PATCH] recover on ssh help message(template), (-) this happens if server machine has an old version of golang --- ssh.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ssh.go b/ssh.go index 8360de89..ecf071c3 100644 --- a/ssh.go +++ b/ssh.go @@ -486,7 +486,13 @@ var standardCommands = Commands{Command{Name: "help", Description: "Opens up the func (s *SSHServer) writeHelp(wr io.Writer) { port := parsePort(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{}{ "Hostname": hostname, "PortDeclaration": "-p " + strconv.Itoa(port), "Commands": append(s.Commands, standardCommands...),