diff options
author | xuri <xuri.me@gmail.com> | 2018-08-06 10:21:24 +0800 |
---|---|---|
committer | xuri <xuri.me@gmail.com> | 2018-08-06 10:21:24 +0800 |
commit | ec37b114c3b704a84c66fcf3e135c9df88ffb24d (patch) | |
tree | 54f67ffacc2364f34712f26f08d9c67094b7d8e7 /file.go | |
parent | efe3219af0c9f8c8248bb5c6ac51e4c7a900396b (diff) |
Fixes #256 and format document.
Diffstat (limited to 'file.go')
-rw-r--r-- | file.go | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -8,7 +8,7 @@ import ( "os" ) -// NewFile provides function to create new file by default template. For +// NewFile provides a function to create new file by default template. For // example: // // xlsx := NewFile() @@ -40,7 +40,7 @@ func NewFile() *File { return f } -// Save provides function to override the xlsx file with origin path. +// Save provides a function to override the xlsx file with origin path. func (f *File) Save() error { if f.Path == "" { return fmt.Errorf("No path defined for file, consider File.WriteTo or File.Write") @@ -48,8 +48,8 @@ func (f *File) Save() error { return f.SaveAs(f.Path) } -// SaveAs provides function to create or update to an xlsx file at the provided -// path. +// SaveAs provides a function to create or update to an xlsx file at the +// provided path. func (f *File) SaveAs(name string) error { file, err := os.OpenFile(name, os.O_WRONLY|os.O_TRUNC|os.O_CREATE, 0666) if err != nil { @@ -59,7 +59,7 @@ func (f *File) SaveAs(name string) error { return f.Write(file) } -// Write provides function to write to an io.Writer. +// Write provides a function to write to an io.Writer. func (f *File) Write(w io.Writer) error { _, err := f.WriteTo(w) return err |