Merge pull request #320 from technosophos/master
Remove panic from help.
This commit is contained in:
commit
ca6f864fa3
4
help.go
4
help.go
@ -180,7 +180,9 @@ func printHelp(out io.Writer, templ string, data interface{}) {
|
|||||||
t := template.Must(template.New("help").Funcs(funcMap).Parse(templ))
|
t := template.Must(template.New("help").Funcs(funcMap).Parse(templ))
|
||||||
err := t.Execute(w, data)
|
err := t.Execute(w, data)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
// If the writer is closed, t.Execute will fail, and there's nothing
|
||||||
|
// we can do to recover. We could send this to os.Stderr if we need.
|
||||||
|
return
|
||||||
}
|
}
|
||||||
w.Flush()
|
w.Flush()
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user