Skip to content
Node: buf.equals(other)github.com/sahilkhaire/gox/buffer

Equals

Overview

Equals reports whether a and b are equal (timing-safe enough for content equality).

If you are coming from Node.js, the closest pattern is buf.equals(other).

Signature

go
func Equals(a, b Buffer) bool

Compare: Node.js · Standard Go · gox

js
buf.equals(other)
go
ok := bytes.Equal(a, b)
go
import "github.com/sahilkhaire/gox/buffer"

buffer.Equals(a, b)

Example

go
import "github.com/sahilkhaire/gox/buffer"

buffer.Equals(a, b)

Tips

Import github.com/sahilkhaire/gox/buffer and call Equals directly. See the comparison below for the standard library equivalent.

Standard library alternative

Use the standard library directly:

go
ok := bytes.Equal(a, b)

Back to buffer package overview

MIT Licensed · Built for Node.js developers moving to Go