Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nasa9084/go-errwriter
https://github.com/nasa9084/go-errwriter
Last synced: 11 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/nasa9084/go-errwriter
- Owner: nasa9084
- License: mit
- Created: 2018-02-27T07:03:28.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-02-27T07:09:10.000Z (over 6 years ago)
- Last Synced: 2024-10-05T00:40:53.190Z (about 1 month ago)
- Language: Go
- Size: 2.93 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# go-errwriter
[![Build Status](https://travis-ci.org/nasa9084/go-errwriter.svg?branch=master)](https://travis-ci.org/nasa9084/go-errwriter)
-----a simple wrapper for io.Writer to help simplify the error handling of Write()
## SYNOPSIS
``` go
package mainimport (
"bytes""github.com/nasa9084/go-errwriter"
)func main() {
buf := bytes.Buffer{}
ew := errwriter.New(&buf)ew.Write([]byte("something error will be occured"))
ew.Write([]byte("this is not record"))
ew.Write([]byte("this is not record"))if _, err := ew.Write(nil); err != nil {
// error handling: error caused when "something error will be occured" is written
}
}
```