diff options
author | Ri Xu <xuri.me@gmail.com> | 2016-10-19 11:27:18 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-10-19 11:27:18 +0800 |
commit | c5cffaac4312cf10f99d7a65891d6a26de090778 (patch) | |
tree | 05502bc267e4c578e5a6695bd3a27dcf643a935c /README.md | |
parent | e50690dce0fb842e5e5408b645cfd9411997938c (diff) |
Update README.md
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -30,6 +30,8 @@ package main import ( "fmt" + "os" + "github.com/Luxurioust/excelize" ) @@ -37,6 +39,7 @@ func main() { xlsx, err := excelize.CreateFile() if err != nil { fmt.Println(err) + os.Exit(1) } xlsx.NewSheet(2, "Sheet2") xlsx.NewSheet(3, "Sheet3") @@ -45,6 +48,7 @@ func main() { err = xlsx.WriteTo("/home/Workbook.xlsx") if err != nil { fmt.Println(err) + os.Exit(1) } } ``` @@ -67,6 +71,7 @@ func main() { xlsx, err := excelize.OpenFile("/home/Workbook.xlsx") if err != nil { fmt.Println(err) + os.Exit(1) } xlsx.SetCellInt("Sheet2", "B2", 100) xlsx.SetCellStr("Sheet2", "C11", "Hello") @@ -77,6 +82,7 @@ func main() { err = xlsx.Save() if err != nil { fmt.Println(err) + os.Exit(1) } } ``` @@ -97,6 +103,7 @@ func main() { xlsx, err := excelize.OpenFile("/home/Workbook.xlsx") if err != nil { fmt.Println(err) + os.Exit(1) } cell := xlsx.GetCellValue("Sheet2", "D11") fmt.Println(cell) @@ -113,4 +120,4 @@ 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 +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). |