blob: d553945344e17532d6e3ec9737526c66a619946e (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
package badtudexo
import (
xl "git.gabbott.dev/george/excelize/v2"
// st "saggytrousers"
)
// Return the header of a given file, which must be the first row.
func GetHeader(file *xl.File, sheet string) ([]string, error) {
rows, err := file.Rows(sheet)
if err != nil {
return []string{}, err
}
rows.Next()
header, err := rows.Columns()
if err != nil {
return []string{}, err
}
return header, nil
}
|