Skip to content

Commit

Permalink
fix getHeaderRow
Browse files Browse the repository at this point in the history
  • Loading branch information
nonotest committed Nov 25, 2018
1 parent 3a7a8d6 commit 6d9c8e8
Showing 1 changed file with 9 additions and 41 deletions.
50 changes: 9 additions & 41 deletions export/sheet.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,49 +117,17 @@ func (se SheetExporter) getSheet(dataSet models.DataSet) *sheets.Sheet {
}

func (se SheetExporter) getHeaderRow() *sheets.RowData {
cells := make([]*sheets.CellData, 0, 2)

handleCell := &sheets.CellData{
UserEnteredValue: &sheets.ExtendedValue{
StringValue: "Screen Name",
},
}
cells = append(cells, handleCell)

countCell := &sheets.CellData{
UserEnteredValue: &sheets.ExtendedValue{
StringValue: "Followers Count",
},
}
cells = append(cells, countCell)

emailCell := &sheets.CellData{
UserEnteredValue: &sheets.ExtendedValue{
StringValue: "Email",
},
}
cells = append(cells, emailCell)
headers := []string{"Screen Name", "Followers Count", "Email", "Name", "URL", "Link"}
cells := make([]*sheets.CellData, 0, len(headers))

nameCell := &sheets.CellData{
UserEnteredValue: &sheets.ExtendedValue{
StringValue: "Name",
},
}
cells = append(cells, nameCell)

urlCell := &sheets.CellData{
UserEnteredValue: &sheets.ExtendedValue{
StringValue: "URL",
},
}
cells = append(cells, urlCell)

linkCell := &sheets.CellData{
UserEnteredValue: &sheets.ExtendedValue{
StringValue: "Link",
},
for _, header := range headers {
cell := &sheets.CellData{
UserEnteredValue: &sheets.ExtendedValue{
StringValue: header,
},
}
cells = append(cells, cell)
}
cells = append(cells, linkCell)

return &sheets.RowData{
Values: cells,
Expand Down

0 comments on commit 6d9c8e8

Please sign in to comment.