-
-
Notifications
You must be signed in to change notification settings - Fork 8
Conversation
Rebase your work upon the latest commit on master, a fix have been made on Toogle typo #65 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you set a example with bada55 output named ExampleToggle
and another one with your version named ExampleToggle_simple
example_byteslice_test.go
Outdated
data := []byte{0x00, 0x01, 0x00} | ||
toogle := []byte{0x01, 0x01, 0x00} | ||
fmt.Printf("%x\n", Toogle(data, toogle)) | ||
// Output: 010101 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The output is 010000, not 010101
Thanks for the feedback. I've added a simple example. If you want, I can squash the last 6 commits, into one. Just to avoid cluttering commit history |
example_byteslice_test.go
Outdated
|
||
output, _ := Toggle(data, toggle) | ||
fmt.Printf("%x\n", output) | ||
// Output: 535155510404 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The output need to be bada55
here, not a byte slice of 6 bytes, so the data and toogle need to be both a byte slice of 3 bytes.
[]byte("bada55")
are not the same as []byte(0xba, 0xda, 0x55)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've changed the slice to not use a string, I've also added two examples, one simple, one regular one. I've also squashed the commits down to one so as not to clutter commit history
2d2549a
to
1d56d10
Compare
One 'simple' example which uses 000 and 1011 One regular example with the output bada55
I've added an example for toogle, but I thought it might be clearer if I didn't use
bada55
as the output, what do you think? Also, should Toogle beToggle
(not sure if that's a daft question).