Charles Iliya Krempeaux a380cfb0e2 | ||
---|---|---|
LICENSE | ||
README.md | ||
buffer.go | ||
doc.go | ||
errors.go | ||
example_writer_test.go | ||
go.mod | ||
go.sum | ||
limitedbuffer_test.go | ||
tooshort.go | ||
writer.go | ||
writer_test.go |
README.md
go-buffers
Package buffers provides tools for working with byte array, and byte slice buffers.
Documention
Online documentation, which includes examples, can be found at: http://godoc.org/github.com/reiver/go-buffers
Example
import "github.com/reiver/go-buffers"
// ...
var buffer [1024]byte
var p []byte = buffer[:]
writer := buffers.NewWriter(p)
n, err := writer.Write(data)
switch casted := err.(type) {
case buffers.TooShort:
//@TODO
default:
return err
}