forked from p30928647/excelize
README updated
This commit is contained in:
parent
34ee74b72a
commit
fabd9d013f
2
LICENSE
2
LICENSE
|
@ -1,6 +1,6 @@
|
|||
BSD 3-Clause License
|
||||
|
||||
Copyright (c) 2016 - 2018 360 Enterprise Security Group, Endpoint Security,
|
||||
Copyright (c) 2016 - 2019 360 Enterprise Security Group, Endpoint Security,
|
||||
inc. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
|
|
10
README.md
10
README.md
|
@ -3,21 +3,17 @@
|
|||
<p align="center">
|
||||
<a href="https://travis-ci.org/360EntSecGroup-Skylar/excelize"><img src="https://travis-ci.org/360EntSecGroup-Skylar/excelize.svg?branch=master" alt="Build Status"></a>
|
||||
<a href="https://codecov.io/gh/360EntSecGroup-Skylar/excelize"><img src="https://codecov.io/gh/360EntSecGroup-Skylar/excelize/branch/master/graph/badge.svg" alt="Code Coverage"></a>
|
||||
<a href="https://app.fossa.io/projects/git%2Bgithub.com%2F360EntSecGroup-Skylar%2Fexcelize?ref=badge_shield" alt="FOSSA Status"><img src="https://app.fossa.io/api/projects/git%2Bgithub.com%2F360EntSecGroup-Skylar%2Fexcelize.svg?type=shield"/></a>
|
||||
<a href="https://goreportcard.com/report/github.com/360EntSecGroup-Skylar/excelize"><img src="https://goreportcard.com/badge/github.com/360EntSecGroup-Skylar/excelize" alt="Go Report Card"></a>
|
||||
<a href="https://godoc.org/github.com/360EntSecGroup-Skylar/excelize"><img src="https://godoc.org/github.com/360EntSecGroup-Skylar/excelize?status.svg" alt="GoDoc"></a>
|
||||
<a href="https://opensource.org/licenses/BSD-3-Clause"><img src="https://img.shields.io/badge/license-bsd-orange.svg" alt="Licenses"></a>
|
||||
<a href="https://www.paypal.me/xuri"><img src="https://img.shields.io/badge/Donate-PayPal-green.svg" alt="Donate"></a>
|
||||
</p>
|
||||
|
||||
|
||||
[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2F360EntSecGroup-Skylar%2Fexcelize.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2F360EntSecGroup-Skylar%2Fexcelize?ref=badge_large)
|
||||
|
||||
# Excelize
|
||||
|
||||
## Introduction
|
||||
|
||||
Excelize is a library written in pure Go and providing a set of functions that allow you to write to and read from XLSX files. Support reads and writes XLSX file generated by Microsoft Excel™ 2007 and later. Support save file without losing original charts of XLSX. This library needs Go version 1.8 or later. The full API docs can be seen using go's built-in documentation tool, or online at [godoc.org](https://godoc.org/github.com/360EntSecGroup-Skylar/excelize) and [docs reference](https://xuri.me/excelize/).
|
||||
Excelize is a library written in pure Go and providing a set of functions that allow you to write to and read from XLSX files. Support reads and writes XLSX file generated by Microsoft Excel™ 2007 and later. Support save file without losing original charts of XLSX. This library needs Go version 1.8 or later. The full API docs can be seen using go's built-in documentation tool, or online at [godoc.org](https://godoc.org/github.com/360EntSecGroup-Skylar/excelize) and [docs reference](https://xuri.me/excelize/).
|
||||
|
||||
## Basic Usage
|
||||
|
||||
|
@ -178,4 +174,6 @@ 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).
|
||||
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).
|
||||
|
||||
[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2F360EntSecGroup-Skylar%2Fexcelize.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2F360EntSecGroup-Skylar%2Fexcelize?ref=badge_large)
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
|
||||
## 简介
|
||||
|
||||
Excelize 是 Go 语言编写的用于操作 Office Excel 文档类库,基于 ECMA-376 Office OpenXML 标准。可以使用它来读取、写入由 Microsoft Excel™ 2007 及以上版本创建的 XLSX 文档。相比较其他的开源类库,Excelize 支持写入原本带有图片(表)、透视表和切片器等复杂样式的文档,还支持向 Excel 文档中插入图片与图表,并且在保存后不会丢失文档原有样式,可以应用于各类报表系统中。使用本类库要求使用的 Go 语言为 1.8 或更高版本,完整的 API 使用文档请访问 [godoc.org](https://godoc.org/github.com/360EntSecGroup-Skylar/excelize) 或查看 [参考文档](https://xuri.me/excelize/)。
|
||||
Excelize 是 Go 语言编写的用于操作 Office Excel 文档类库,基于 ECMA-376 Office OpenXML 标准。可以使用它来读取、写入由 Microsoft Excel™ 2007 及以上版本创建的 XLSX 文档。相比较其他的开源类库,Excelize 支持写入原本带有图片(表)、透视表和切片器等复杂样式的文档,还支持向 Excel 文档中插入图片与图表,并且在保存后不会丢失文档原有样式,可以应用于各类报表系统中。使用本类库要求使用的 Go 语言为 1.8 或更高版本,完整的 API 使用文档请访问 [godoc.org](https://godoc.org/github.com/360EntSecGroup-Skylar/excelize) 或查看 [参考文档](https://xuri.me/excelize/)。
|
||||
|
||||
## 快速上手
|
||||
|
||||
|
@ -175,3 +175,5 @@ func main() {
|
|||
## 开源许可
|
||||
|
||||
本项目遵循 BSD 3-Clause 开源许可协议,访问 [https://opensource.org/licenses/BSD-3-Clause](https://opensource.org/licenses/BSD-3-Clause) 查看许可协议文件。
|
||||
|
||||
[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2F360EntSecGroup-Skylar%2Fexcelize.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2F360EntSecGroup-Skylar%2Fexcelize?ref=badge_large)
|
||||
|
|
2
cell.go
2
cell.go
|
@ -1,4 +1,4 @@
|
|||
// Copyright 2016 - 2018 The excelize Authors. All rights reserved. Use of
|
||||
// Copyright 2016 - 2019 The excelize Authors. All rights reserved. Use of
|
||||
// this source code is governed by a BSD-style license that can be found in
|
||||
// the LICENSE file.
|
||||
//
|
||||
|
|
2
chart.go
2
chart.go
|
@ -1,4 +1,4 @@
|
|||
// Copyright 2016 - 2018 The excelize Authors. All rights reserved. Use of
|
||||
// Copyright 2016 - 2019 The excelize Authors. All rights reserved. Use of
|
||||
// this source code is governed by a BSD-style license that can be found in
|
||||
// the LICENSE file.
|
||||
//
|
||||
|
|
2
col.go
2
col.go
|
@ -1,4 +1,4 @@
|
|||
// Copyright 2016 - 2018 The excelize Authors. All rights reserved. Use of
|
||||
// Copyright 2016 - 2019 The excelize Authors. All rights reserved. Use of
|
||||
// this source code is governed by a BSD-style license that can be found in
|
||||
// the LICENSE file.
|
||||
//
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright 2016 - 2018 The excelize Authors. All rights reserved. Use of
|
||||
// Copyright 2016 - 2019 The excelize Authors. All rights reserved. Use of
|
||||
// this source code is governed by a BSD-style license that can be found in
|
||||
// the LICENSE file.
|
||||
//
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright 2016 - 2018 The excelize Authors. All rights reserved. Use of
|
||||
// Copyright 2016 - 2019 The excelize Authors. All rights reserved. Use of
|
||||
// this source code is governed by a BSD-style license that can be found in
|
||||
// the LICENSE file.
|
||||
//
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright 2016 - 2018 The excelize Authors. All rights reserved. Use of
|
||||
// Copyright 2016 - 2019 The excelize Authors. All rights reserved. Use of
|
||||
// this source code is governed by a BSD-style license that can be found in
|
||||
// the LICENSE file.
|
||||
//
|
||||
|
|
2
date.go
2
date.go
|
@ -1,4 +1,4 @@
|
|||
// Copyright 2016 - 2018 The excelize Authors. All rights reserved. Use of
|
||||
// Copyright 2016 - 2019 The excelize Authors. All rights reserved. Use of
|
||||
// this source code is governed by a BSD-style license that can be found in
|
||||
// the LICENSE file.
|
||||
//
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright 2016 - 2018 The excelize Authors. All rights reserved. Use of
|
||||
// Copyright 2016 - 2019 The excelize Authors. All rights reserved. Use of
|
||||
// this source code is governed by a BSD-style license that can be found in
|
||||
// the LICENSE file.
|
||||
|
||||
|
|
|
@ -129,6 +129,19 @@ func TestOpenFile(t *testing.T) {
|
|||
assert.NoError(t, xlsx.SaveAs("./test/TestOpenFile.xlsx"))
|
||||
}
|
||||
|
||||
func TestSaveFile(t *testing.T) {
|
||||
xlsx, err := OpenFile("./test/Book1.xlsx")
|
||||
if !assert.NoError(t, err) {
|
||||
t.FailNow()
|
||||
}
|
||||
assert.NoError(t, xlsx.SaveAs("./test/TestSaveFile.xlsx"))
|
||||
xlsx, err = OpenFile("./test/TestSaveFile.xlsx")
|
||||
if !assert.NoError(t, err) {
|
||||
t.FailNow()
|
||||
}
|
||||
assert.NoError(t, xlsx.Save())
|
||||
}
|
||||
|
||||
func TestSaveAsWrongPath(t *testing.T) {
|
||||
xlsx, err := OpenFile("./test/Book1.xlsx")
|
||||
if assert.NoError(t, err) {
|
||||
|
@ -309,7 +322,7 @@ func TestGetCellHyperLink(t *testing.T) {
|
|||
|
||||
link, target := xlsx.GetCellHyperLink("Sheet1", "")
|
||||
t.Log(link, target)
|
||||
link, target = xlsx.GetCellHyperLink("Sheet1", "B19")
|
||||
link, target = xlsx.GetCellHyperLink("Sheet1", "A22")
|
||||
t.Log(link, target)
|
||||
link, target = xlsx.GetCellHyperLink("Sheet2", "D6")
|
||||
t.Log(link, target)
|
||||
|
@ -1082,7 +1095,7 @@ func TestInsertRow(t *testing.T) {
|
|||
|
||||
func TestDuplicateRow(t *testing.T) {
|
||||
const (
|
||||
file = "./test/TestDuplicateRow" +
|
||||
file = "./test/TestDuplicateRow" +
|
||||
".%s.xlsx"
|
||||
sheet = "Sheet1"
|
||||
a1 = "A1"
|
||||
|
|
2
file.go
2
file.go
|
@ -1,4 +1,4 @@
|
|||
// Copyright 2016 - 2018 The excelize Authors. All rights reserved. Use of
|
||||
// Copyright 2016 - 2019 The excelize Authors. All rights reserved. Use of
|
||||
// this source code is governed by a BSD-style license that can be found in
|
||||
// the LICENSE file.
|
||||
//
|
||||
|
|
2
lib.go
2
lib.go
|
@ -1,4 +1,4 @@
|
|||
// Copyright 2016 - 2018 The excelize Authors. All rights reserved. Use of
|
||||
// Copyright 2016 - 2019 The excelize Authors. All rights reserved. Use of
|
||||
// this source code is governed by a BSD-style license that can be found in
|
||||
// the LICENSE file.
|
||||
//
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright 2016 - 2018 The excelize Authors. All rights reserved. Use of
|
||||
// Copyright 2016 - 2019 The excelize Authors. All rights reserved. Use of
|
||||
// this source code is governed by a BSD-style license that can be found in
|
||||
// the LICENSE file.
|
||||
//
|
||||
|
|
2
rows.go
2
rows.go
|
@ -1,4 +1,4 @@
|
|||
// Copyright 2016 - 2018 The excelize Authors. All rights reserved. Use of
|
||||
// Copyright 2016 - 2019 The excelize Authors. All rights reserved. Use of
|
||||
// this source code is governed by a BSD-style license that can be found in
|
||||
// the LICENSE file.
|
||||
//
|
||||
|
|
2
shape.go
2
shape.go
|
@ -1,4 +1,4 @@
|
|||
// Copyright 2016 - 2018 The excelize Authors. All rights reserved. Use of
|
||||
// Copyright 2016 - 2019 The excelize Authors. All rights reserved. Use of
|
||||
// this source code is governed by a BSD-style license that can be found in
|
||||
// the LICENSE file.
|
||||
//
|
||||
|
|
2
sheet.go
2
sheet.go
|
@ -1,4 +1,4 @@
|
|||
// Copyright 2016 - 2018 The excelize Authors. All rights reserved. Use of
|
||||
// Copyright 2016 - 2019 The excelize Authors. All rights reserved. Use of
|
||||
// this source code is governed by a BSD-style license that can be found in
|
||||
// the LICENSE file.
|
||||
//
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright 2016 - 2018 The excelize Authors. All rights reserved. Use of
|
||||
// Copyright 2016 - 2019 The excelize Authors. All rights reserved. Use of
|
||||
// this source code is governed by a BSD-style license that can be found in
|
||||
// the LICENSE file.
|
||||
//
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright 2016 - 2018 The excelize Authors. All rights reserved. Use of
|
||||
// Copyright 2016 - 2019 The excelize Authors. All rights reserved. Use of
|
||||
// this source code is governed by a BSD-style license that can be found in
|
||||
// the LICENSE file.
|
||||
//
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright 2016 - 2018 The excelize Authors. All rights reserved. Use of
|
||||
// Copyright 2016 - 2019 The excelize Authors. All rights reserved. Use of
|
||||
// this source code is governed by a BSD-style license that can be found in
|
||||
// the LICENSE file.
|
||||
//
|
||||
|
|
2
table.go
2
table.go
|
@ -1,4 +1,4 @@
|
|||
// Copyright 2016 - 2018 The excelize Authors. All rights reserved. Use of
|
||||
// Copyright 2016 - 2019 The excelize Authors. All rights reserved. Use of
|
||||
// this source code is governed by a BSD-style license that can be found in
|
||||
// the LICENSE file.
|
||||
//
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright 2016 - 2018 The excelize Authors. All rights reserved. Use of
|
||||
// Copyright 2016 - 2019 The excelize Authors. All rights reserved. Use of
|
||||
// this source code is governed by a BSD-style license that can be found in
|
||||
// the LICENSE file.
|
||||
//
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright 2016 - 2018 The excelize Authors. All rights reserved. Use of
|
||||
// Copyright 2016 - 2019 The excelize Authors. All rights reserved. Use of
|
||||
// this source code is governed by a BSD-style license that can be found in
|
||||
// the LICENSE file.
|
||||
//
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright 2016 - 2018 The excelize Authors. All rights reserved. Use of
|
||||
// Copyright 2016 - 2019 The excelize Authors. All rights reserved. Use of
|
||||
// this source code is governed by a BSD-style license that can be found in
|
||||
// the LICENSE file.
|
||||
//
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright 2016 - 2018 The excelize Authors. All rights reserved. Use of
|
||||
// Copyright 2016 - 2019 The excelize Authors. All rights reserved. Use of
|
||||
// this source code is governed by a BSD-style license that can be found in
|
||||
// the LICENSE file.
|
||||
//
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright 2016 - 2018 The excelize Authors. All rights reserved. Use of
|
||||
// Copyright 2016 - 2019 The excelize Authors. All rights reserved. Use of
|
||||
// this source code is governed by a BSD-style license that can be found in
|
||||
// the LICENSE file.
|
||||
//
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright 2016 - 2018 The excelize Authors. All rights reserved. Use of
|
||||
// Copyright 2016 - 2019 The excelize Authors. All rights reserved. Use of
|
||||
// this source code is governed by a BSD-style license that can be found in
|
||||
// the LICENSE file.
|
||||
//
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright 2016 - 2018 The excelize Authors. All rights reserved. Use of
|
||||
// Copyright 2016 - 2019 The excelize Authors. All rights reserved. Use of
|
||||
// this source code is governed by a BSD-style license that can be found in
|
||||
// the LICENSE file.
|
||||
//
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright 2016 - 2018 The excelize Authors. All rights reserved. Use of
|
||||
// Copyright 2016 - 2019 The excelize Authors. All rights reserved. Use of
|
||||
// this source code is governed by a BSD-style license that can be found in
|
||||
// the LICENSE file.
|
||||
//
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright 2016 - 2018 The excelize Authors. All rights reserved. Use of
|
||||
// Copyright 2016 - 2019 The excelize Authors. All rights reserved. Use of
|
||||
// this source code is governed by a BSD-style license that can be found in
|
||||
// the LICENSE file.
|
||||
//
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright 2016 - 2018 The excelize Authors. All rights reserved. Use of
|
||||
// Copyright 2016 - 2019 The excelize Authors. All rights reserved. Use of
|
||||
// this source code is governed by a BSD-style license that can be found in
|
||||
// the LICENSE file.
|
||||
//
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright 2016 - 2018 The excelize Authors. All rights reserved. Use of
|
||||
// Copyright 2016 - 2019 The excelize Authors. All rights reserved. Use of
|
||||
// this source code is governed by a BSD-style license that can be found in
|
||||
// the LICENSE file.
|
||||
//
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright 2016 - 2018 The excelize Authors. All rights reserved. Use of
|
||||
// Copyright 2016 - 2019 The excelize Authors. All rights reserved. Use of
|
||||
// this source code is governed by a BSD-style license that can be found in
|
||||
// the LICENSE file.
|
||||
//
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright 2016 - 2018 The excelize Authors. All rights reserved. Use of
|
||||
// Copyright 2016 - 2019 The excelize Authors. All rights reserved. Use of
|
||||
// this source code is governed by a BSD-style license that can be found in
|
||||
// the LICENSE file.
|
||||
//
|
||||
|
|
Loading…
Reference in New Issue