From 30c1a30168dfff8ca5eecb8d0fa42ab4b638f79d Mon Sep 17 00:00:00 2001 From: Koni Marti Date: Sat, 6 May 2023 11:30:48 +0200 Subject: templates: use template interface consistently Use the template interface consistently. Before, we have exported the state.TemplateData struct and used it in most places instead of the models.TemplateData interface. This lead to some inconsistencies, i.e. Role() has been defined on the exported struct but not on the interface. Unexport the state.TemplateData struct, add a DataSetter interface to set the data needed for the template data and call the Data() method which returns a models.TemplateData interface when the template data is needed. Signed-off-by: Koni Marti Acked-by: Tim Culverhouse --- models/templates.go | 1 + 1 file changed, 1 insertion(+) (limited to 'models/templates.go') diff --git a/models/templates.go b/models/templates.go index cebad5ea..f6d79c36 100644 --- a/models/templates.go +++ b/models/templates.go @@ -26,6 +26,7 @@ type TemplateData interface { Labels() []string Flags() []string MessageId() string + Role() string Size() int OriginalText() string OriginalDate() time.Time -- cgit