From 0e61ae7eda79e7b4e6501c64cf75dea0923489b3 Mon Sep 17 00:00:00 2001 From: Ri Xu Date: Wed, 31 Aug 2016 19:27:44 +0800 Subject: [PATCH] 1) Update readme file credits and go report badge added; 2) Remove use less function; 3) Update test file. --- LICENSE.md | 27 +++++++++++++++++++++++++++ README.md | 5 +++++ excelize_test.go | 1 + lib.go | 10 ---------- xmlContentTypes.go | 2 ++ xmlSharedStrings.go | 2 ++ xmlWorkbook.go | 2 ++ xmlWorksheet.go | 2 ++ 8 files changed, 41 insertions(+), 10 deletions(-) create mode 100644 LICENSE.md diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 00000000..c391b00f --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,27 @@ +Copyright (c) 2016, Ri Xu +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +* Neither the name of [project] nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/README.md b/README.md index 56b99513..dfe62489 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,7 @@ [![Build Status](https://travis-ci.org/Luxurioust/excelize.svg?branch=master)](https://travis-ci.org/Luxurioust/excelize) [![Code Coverage](https://codecov.io/gh/Luxurioust/excelize/branch/master/graph/badge.svg)](https://codecov.io/gh/Luxurioust/excelize) +[![Go Report Card](https://goreportcard.com/badge/github.com/Luxurioust/excelize)](https://goreportcard.com/report/github.com/Luxurioust/excelize) [![GoDoc](https://godoc.org/github.com/Luxurioust/excelize?status.svg)](https://godoc.org/github.com/Luxurioust/excelize) [![Licenses](https://img.shields.io/badge/license-bsd-orange.svg)](https://opensource.org/licenses/BSD-3-Clause) [![Join the chat at https://gitter.im/xuri-excelize/Lobby](https://img.shields.io/badge/GITTER-join%20chat-green.svg)](https://gitter.im/xuri-excelize/Lobby) @@ -79,6 +80,10 @@ func main() { Contributions are welcome! Open a pull request to fix a bug, or open an issue to discuss a new feature or change. +### Credits + +Some struct of XML originally by [tealeg/xlsx](https://github.com/tealeg/xlsx). + ## Licenses This program is under the terms of the BSD 3-Clause License. See [https://opensource.org/licenses/BSD-3-Clause](https://opensource.org/licenses/BSD-3-Clause). \ No newline at end of file diff --git a/excelize_test.go b/excelize_test.go index 5dbcdb41..69f79642 100644 --- a/excelize_test.go +++ b/excelize_test.go @@ -41,6 +41,7 @@ func TestExcelize(t *testing.T) { if err != nil { t.Error(err) } + GetCellValue(file, "Sheet2", "a-1") GetCellValue(file, "Sheet2", "a5") GetCellValue(file, "Sheet2", "D11") GetCellValue(file, "Sheet2", "D12") diff --git a/lib.go b/lib.go index e3d7a4ff..27b08e5f 100644 --- a/lib.go +++ b/lib.go @@ -6,7 +6,6 @@ import ( "io" "log" "math" - "os" "regexp" "strconv" "strings" @@ -100,15 +99,6 @@ func titleToNumber(s string) int { return sum - 1 } -// Check the file exists -func pathExist(_path string) bool { - _, err := os.Stat(_path) - if err != nil && os.IsNotExist(err) { - return false - } - return true -} - // Split Excel sheet column title to string and integer, return XAxis func getColIndex(axis string) string { r, err := regexp.Compile(`[^\D]`) diff --git a/xmlContentTypes.go b/xmlContentTypes.go index c9e03f60..86f3b440 100644 --- a/xmlContentTypes.go +++ b/xmlContentTypes.go @@ -1,3 +1,5 @@ +// Some code of this file reference tealeg/xlsx + package excelize import ( diff --git a/xmlSharedStrings.go b/xmlSharedStrings.go index 22401f0a..f4294601 100644 --- a/xmlSharedStrings.go +++ b/xmlSharedStrings.go @@ -1,3 +1,5 @@ +// Some code of this file reference tealeg/xlsx + package excelize import ( diff --git a/xmlWorkbook.go b/xmlWorkbook.go index 2bbeeed7..3c63d85b 100644 --- a/xmlWorkbook.go +++ b/xmlWorkbook.go @@ -1,3 +1,5 @@ +// Some code of this file reference tealeg/xlsx + package excelize import ( diff --git a/xmlWorksheet.go b/xmlWorksheet.go index 8c1e8498..a5744c96 100644 --- a/xmlWorksheet.go +++ b/xmlWorksheet.go @@ -1,3 +1,5 @@ +// Some code of this file reference tealeg/xlsx + package excelize import (