Skip to content

Conversation

@sonicfromnewyoke
Copy link

Problem

In Go, when comparing two byte slices for equality, it is recommended to use bytes.Equal(x, y) instead of bytes.Compare(x, y) == 0.

Solution

use bytes.Equal(x, y) instead of bytes.Compare(x, y) == 0.

cc @7layermagik

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant