From 4b6fa363251b7f7a92bf60663dce618f6df50576 Mon Sep 17 00:00:00 2001 From: Tommy Situ Date: Fri, 23 Aug 2024 18:43:18 +0100 Subject: [PATCH] Pass locks by pointer --- core/templating/datasource.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/templating/datasource.go b/core/templating/datasource.go index 0dcaf9f0e..e1e3abc83 100644 --- a/core/templating/datasource.go +++ b/core/templating/datasource.go @@ -27,7 +27,7 @@ func NewCsvDataSource(fileName, fileContent string) (*DataSource, error) { return &DataSource{"csv", fileName, records, sync.Mutex{}}, nil } -func (dataSource DataSource) GetDataSourceView() (v2.CSVDataSourceView, error) { +func (dataSource *DataSource) GetDataSourceView() (v2.CSVDataSourceView, error) { content, err := getData(dataSource) if err != nil { @@ -36,7 +36,7 @@ func (dataSource DataSource) GetDataSourceView() (v2.CSVDataSourceView, error) { return v2.CSVDataSourceView{Name: dataSource.Name, Data: content}, nil } -func getData(source DataSource) (string, error) { +func getData(source *DataSource) (string, error) { var csvData strings.Builder csvWriter := csv.NewWriter(&csvData)