diff options
author | xuri <xuri.me@gmail.com> | 2020-01-03 23:57:25 +0800 |
---|---|---|
committer | xuri <xuri.me@gmail.com> | 2020-01-03 23:57:25 +0800 |
commit | 5ca7231ed408ac264f509ff52b5d28ff4fbda757 (patch) | |
tree | af91efcb8b83c75c97cb43c9fac442adccfdcd26 /sheetpr_test.go | |
parent | 5f5ec76740704a8362e5a120b4a3582b409a5fdd (diff) |
optimize code and comments: use println errors instead of panic
Diffstat (limited to 'sheetpr_test.go')
-rw-r--r-- | sheetpr_test.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sheetpr_test.go b/sheetpr_test.go index d1ae2f1..6a35a6e 100644 --- a/sheetpr_test.go +++ b/sheetpr_test.go @@ -40,7 +40,7 @@ func ExampleFile_SetSheetPrOptions() { excelize.AutoPageBreaks(true), excelize.OutlineSummaryBelow(false), ); err != nil { - panic(err) + println(err.Error()) } // Output: } @@ -66,7 +66,7 @@ func ExampleFile_GetSheetPrOptions() { &autoPageBreaks, &outlineSummaryBelow, ); err != nil { - panic(err) + println(err.Error()) } fmt.Println("Defaults:") fmt.Printf("- codeName: %q\n", codeName) @@ -189,7 +189,7 @@ func ExampleFile_SetPageMargins() { excelize.PageMarginRight(1.0), excelize.PageMarginTop(1.0), ); err != nil { - panic(err) + println(err.Error()) } // Output: } @@ -215,7 +215,7 @@ func ExampleFile_GetPageMargins() { &marginRight, &marginTop, ); err != nil { - panic(err) + println(err.Error()) } fmt.Println("Defaults:") fmt.Println("- marginBottom:", marginBottom) |