From f67ce5ac8d8bc3f47563dd6512946d8947cf412a Mon Sep 17 00:00:00 2001 From: Dave Henderson Date: Thu, 4 Aug 2022 19:52:09 -0400 Subject: Fix lint errors Signed-off-by: Dave Henderson --- data/data.go | 39 ++++++++++++++++++++++++--------------- 1 file changed, 24 insertions(+), 15 deletions(-) (limited to 'data/data.go') diff --git a/data/data.go b/data/data.go index 0c81dc54..96f82e7f 100644 --- a/data/data.go +++ b/data/data.go @@ -258,10 +258,13 @@ func autoIndex(i int) string { // CSV - Unmarshal CSV // parameters: -// delim - (optional) the (single-character!) field delimiter, defaults to "," -// in - the CSV-format string to parse +// +// delim - (optional) the (single-character!) field delimiter, defaults to "," +// in - the CSV-format string to parse +// // returns: -// an array of rows, which are arrays of cells (strings) +// +// an array of rows, which are arrays of cells (strings) func CSV(args ...string) ([][]string, error) { records, hdr, err := parseCSV(args...) if err != nil { @@ -275,13 +278,16 @@ func CSV(args ...string) ([][]string, error) { // CSVByRow - Unmarshal CSV in a row-oriented form // parameters: -// delim - (optional) the (single-character!) field delimiter, defaults to "," -// hdr - (optional) comma-separated list of column names, -// set to "" to get auto-named columns (A-Z), omit -// to use the first line -// in - the CSV-format string to parse +// +// delim - (optional) the (single-character!) field delimiter, defaults to "," +// hdr - (optional) comma-separated list of column names, +// set to "" to get auto-named columns (A-Z), omit +// to use the first line +// in - the CSV-format string to parse +// // returns: -// an array of rows, indexed by the header name +// +// an array of rows, indexed by the header name func CSVByRow(args ...string) (rows []map[string]string, err error) { records, hdr, err := parseCSV(args...) if err != nil { @@ -299,13 +305,16 @@ func CSVByRow(args ...string) (rows []map[string]string, err error) { // CSVByColumn - Unmarshal CSV in a Columnar form // parameters: -// delim - (optional) the (single-character!) field delimiter, defaults to "," -// hdr - (optional) comma-separated list of column names, -// set to "" to get auto-named columns (A-Z), omit -// to use the first line -// in - the CSV-format string to parse +// +// delim - (optional) the (single-character!) field delimiter, defaults to "," +// hdr - (optional) comma-separated list of column names, +// set to "" to get auto-named columns (A-Z), omit +// to use the first line +// in - the CSV-format string to parse +// // returns: -// a map of columns, indexed by the header name. values are arrays of strings +// +// a map of columns, indexed by the header name. values are arrays of strings func CSVByColumn(args ...string) (cols map[string][]string, err error) { records, hdr, err := parseCSV(args...) if err != nil { -- cgit v1.2.3