Skip to content

Commit

Permalink
Pass locks by pointer
Browse files Browse the repository at this point in the history
  • Loading branch information
tommysitu committed Aug 23, 2024
1 parent f840dbd commit 4b6fa36
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/templating/datasource.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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)
Expand Down

0 comments on commit 4b6fa36

Please sign in to comment.