diff options
author | xuri <xuri.me@gmail.com> | 2020-05-23 13:29:51 +0800 |
---|---|---|
committer | xuri <xuri.me@gmail.com> | 2020-05-23 13:29:51 +0800 |
commit | 7f78464f7f6ecd87c5f5c53d7c00320fd53c4a03 (patch) | |
tree | 0a1de4ead6b9f87af41932ab64fdd8147cc36cf9 /lib.go | |
parent | 82bb1153d7b7ff1c50725bf34bd3cbc75b228137 (diff) |
add test for ReadZipReader, close #642
Diffstat (limited to 'lib.go')
-rw-r--r-- | lib.go | 14 |
1 files changed, 2 insertions, 12 deletions
@@ -15,7 +15,6 @@ import ( "container/list" "fmt" "io" - "log" "strconv" "strings" "unsafe" @@ -59,7 +58,6 @@ func (f *File) saveFileList(name string, content []byte) { func readFile(file *zip.File) ([]byte, error) { rc, err := file.Open() if err != nil { - log.Println(err) return nil, err } dat := make([]byte, 0, file.FileInfo().Size()) @@ -176,11 +174,7 @@ func CellNameToCoordinates(cell string) (int, int, error) { } col, err := ColumnNameToNumber(colname) - if err != nil { - return -1, -1, fmt.Errorf(msg, cell, err) - } - - return col, row, nil + return col, row, err } // CoordinatesToCellName converts [X, Y] coordinates to alpha-numeric cell @@ -195,11 +189,7 @@ func CoordinatesToCellName(col, row int) (string, error) { return "", fmt.Errorf("invalid cell coordinates [%d, %d]", col, row) } colname, err := ColumnNumberToName(col) - if err != nil { - // Error should never happens here. - return "", fmt.Errorf("invalid cell coordinates [%d, %d]: %v", col, row, err) - } - return fmt.Sprintf("%s%d", colname, row), nil + return fmt.Sprintf("%s%d", colname, row), err } // boolPtr returns a pointer to a bool with the given value. |