mirror of
https://github.com/jwetzell/showbridge-go.git
synced 2026-04-26 21:05:30 +00:00
use a struct to pass multiple pieces of data into templating context
This commit is contained in:
@@ -15,8 +15,10 @@ type StringCreate struct {
|
||||
}
|
||||
|
||||
func (sc *StringCreate) Process(ctx context.Context, payload any) (any, error) {
|
||||
templateData := GetTemplateData(ctx, payload)
|
||||
|
||||
var templateBuffer bytes.Buffer
|
||||
err := sc.Template.Execute(&templateBuffer, payload)
|
||||
err := sc.Template.Execute(&templateBuffer, templateData)
|
||||
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
||||
Reference in New Issue
Block a user