doggo/cmd/help.go

22 lines
384 B
Go
Raw Normal View History

2020-12-13 13:19:10 +01:00
package main
import (
"fmt"
"io"
)
// Override Help Template
var helpTmpl = `NAME:
{{.Name}}
{{ range $key, $value := . }}
<li><strong>{{ $key }}</strong>: {{ $value }}</li>
{{ end }}
`
func renderCustomHelp(w io.Writer, templ string, data interface{}) {
var helpTmplVars = map[string]string{}
helpTmplVars["Name"] = "doggo"
fmt.Fprintf(w, helpTmpl, helpTmplVars)
}