Buffer
Overview
Buffer is a byte slice with helper methods.
Part of the buffer package — Node.js analog: Buffer.
Buffer is a type exported by gox. Methods on this type are documented separately.
Signature
go
type Buffer []byteCompare: Node.js · Standard Go · gox
js
// Typical Buffer pattern in Node.jsgo
// Use the underlying stdlib or driver directly.
// See package overview for escape hatches.go
import "github.com/sahilkhaire/gox/buffer"
a := FromString("ab")
b := From([]byte("ab"))
c := Concat(FromString("a"), FromString("b"))Example
go
import "github.com/sahilkhaire/gox/buffer"
a := FromString("ab")
b := From([]byte("ab"))
c := Concat(FromString("a"), FromString("b"))Tips
Browse methods on this type in the sidebar for handler-style APIs and options structs.
Standard library alternative
gox wraps the Go standard library or a trusted dependency with Node-familiar naming. You can use the underlying library directly — see the package overview for escape hatches.