Package buffers provides tools for working with byte array, and byte slice buffers, for the Go programming language.
Go to file
Charles Iliya Krempeaux 32b419923a updated README.md 2023-10-25 14:08:25 -07:00
LICENSE initial commit 2019-09-05 18:28:37 -07:00
README.md updated README.md 2023-10-25 14:08:25 -07:00
buffer.go github.com/reiver/go-utf8 -> sourcecode.social/reiver/go-utf8 2023-10-25 14:05:07 -07:00
doc.go github.com/reiver/go-buffers -> sourcecode.social/reiver/go-buffers 2023-10-25 14:07:03 -07:00
errors.go github.com/reiver/go-fck -> sourcecode.social/reiver/go-erorr 2023-10-25 14:01:31 -07:00
example_writer_test.go github.com/reiver/go-buffers -> sourcecode.social/reiver/go-buffers 2023-10-25 14:07:03 -07:00
go.mod github.com/reiver/go-buffers -> sourcecode.social/reiver/go-buffers 2023-10-25 14:07:03 -07:00
go.sum github.com/reiver/go-utf8 -> sourcecode.social/reiver/go-utf8 2023-10-25 14:05:07 -07:00
limitedbuffer_test.go github.com/reiver/go-buffers -> sourcecode.social/reiver/go-buffers 2023-10-25 14:07:03 -07:00
tooshort.go buffers.TooShort 2019-09-05 18:31:59 -07:00
writer.go made buffers.NewWriter() return a *buffers.Writer, rather than a buffers.Writer 2019-09-05 18:53:40 -07:00
writer_test.go github.com/reiver/go-buffers -> sourcecode.social/reiver/go-buffers 2023-10-25 14:07:03 -07:00

README.md

go-buffers

Package buffers provides tools for working with byte array, and byte slice buffers, for the Go programming language.

Documention

Online documentation, which includes examples, can be found at: http://godoc.org/sourcecode.social/reiver/go-buffers

GoDoc

Example

import "sourcecode.social/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
}