Skip to content
This repository has been archived by the owner on Jul 12, 2022. It is now read-only.

Commit

Permalink
Add Flip example, fix #34
Browse files Browse the repository at this point in the history
  • Loading branch information
andreis committed Oct 31, 2017
1 parent 97bd93e commit 2804b56
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion example_byteslice_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@ package byteslice

import "fmt"

func ExampleFlip() {
data := []byte{0x55, 0xDA, 0xBA}

fmt.Printf("%x\n", Flip(data))
// Output: aa2545
}

func ExampleReverse() {
data := []byte{0x55, 0xDA, 0xBA}

Expand All @@ -11,7 +18,7 @@ func ExampleReverse() {

func ExampleLPad() {
data := []byte{0x55, 0xDA, 0xBA}

fmt.Printf("%x\n", LPad(data, 5, 0x22))
// Output: 222255daba
}

0 comments on commit 2804b56

Please sign in to comment.