diff options
author | Matthew Lemon <lemon@matthewlemon.com> | 2019-11-03 22:42:31 +0000 |
---|---|---|
committer | Matthew Lemon <lemon@matthewlemon.com> | 2019-11-03 22:42:31 +0000 |
commit | 61fee2359943345d32d1bb6bea610ee7f4ee1d0b (patch) | |
tree | c2063954d148c9d61686a8c714f1885833742202 /reader/reader.go | |
parent | 185d22497864550413a20fc8ce2647b94a7b229b (diff) |
doing things right by cleaning up
Diffstat (limited to 'reader/reader.go')
-rw-r--r-- | reader/reader.go | 25 |
1 files changed, 8 insertions, 17 deletions
diff --git a/reader/reader.go b/reader/reader.go index cda8350..81b692d 100644 --- a/reader/reader.go +++ b/reader/reader.go @@ -17,6 +17,8 @@ const ( maxAlphabets = (maxCols / 26) - 1 ) +var alphaStream = alphas(maxAlphabets) + //DatamapLine - a line from the datamap. type DatamapLine struct { Key string @@ -24,13 +26,12 @@ type DatamapLine struct { Cellref string } -type fileError struct { - file string - msg string -} - -func (e *fileError) Error() string { - return fmt.Sprintf("%s", e.msg) +//ExtractedCell is Data pulled from a cell +type ExtractedCell struct { + cell *xlsx.Cell + colL string + rowLidx int + value string } //Keylens returns the length of a key @@ -67,14 +68,6 @@ func ReadDML(path string) ([]DatamapLine, error) { return s, nil } -//ExtractedCell is Data pulled from a cell -type ExtractedCell struct { - cell *xlsx.Cell - colL string - rowLidx int - value string -} - //alphSingle generates all the letters of the alphabet func alphaSingle() []string { letters := make([]string, 26) @@ -84,8 +77,6 @@ func alphaSingle() []string { return letters } -var alphaStream = alphas(maxAlphabets) - //alphas generates the alpha column compont of Excel cell references //Adds n alphabets to the first (A..Z) alphabet. func alphas(n int) []string { |