twitch-bot/actorDocs.go
Knut Ahlers 8247978151
[lint] Properly format inputs
Signed-off-by: Knut Ahlers <knut@ahlers.me>
2021-11-25 23:48:16 +01:00

28 lines
605 B
Go

package main
import (
"bytes"
_ "embed"
"text/template"
"github.com/pkg/errors"
"github.com/Luzifer/twitch-bot/plugins"
)
//go:embed actorDocs.tpl
var actorDocsTemplate string
func generateActorDocs() ([]byte, error) {
tpl, err := template.New("actorDocs").Parse(actorDocsTemplate)
if err != nil {
return nil, errors.Wrap(err, "parsing actorDocs template")
}
buf := new(bytes.Buffer)
if err := tpl.Execute(buf, struct{ Actors []plugins.ActionDocumentation }{availableActorDocs}); err != nil {
return nil, errors.Wrap(err, "rendering actorDocs template")
}
return buf.Bytes(), nil
}