diff options
author | Matthew Lemon <lemon@matthewlemon.com> | 2019-12-03 21:24:47 +0000 |
---|---|---|
committer | Matthew Lemon <lemon@matthewlemon.com> | 2019-12-03 21:24:47 +0000 |
commit | 27aee57258f81ef6b381f45bbd4c0f337a201f67 (patch) | |
tree | 12dbe08033673153308351f81e4e66566548a9cf /coords.go | |
parent | f39a87827136188197ab34576d2d9b2d533505c0 (diff) |
making colstream unexported and re-exporting the two funcs
Diffstat (limited to 'coords.go')
-rw-r--r-- | coords.go | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -15,23 +15,23 @@ const ( // ColAlpha returns an alpha representation of a column index. // index is an integer - ColAlpha(0) returns "A", etc. -func colIndexToAlpha(index int) (string, error) { - max := len(Colstream) - 1 +func ColIndexToAlpha(index int) (string, error) { + max := len(colstream) - 1 if index <= max { - return Colstream[index], nil + return colstream[index], nil } else { msg := fmt.Sprintf("cannot have more than %d columns", max) return "", errors.New(msg) } } -var Colstream = cols(maxAlphabets) +var colstream = cols(maxAlphabets) // ColLettersToIndex converts an alpha column // reference to a zero-based numeric column identifier. -func colAlphaToIndex(letters string) (int, error) { - max := len(Colstream) - 1 - for i, v := range Colstream { +func ColAlphaToIndex(letters string) (int, error) { + max := len(colstream) - 1 + for i, v := range colstream { if i > max { msg := fmt.Sprintf("Cannot exceed maximum of %d", max) return 0, errors.New(msg) |