Skip to content

Commit

Permalink
Update Print Function to Accept io.Writer and not use os.StdOut by de…
Browse files Browse the repository at this point in the history
…fault (#24)

* Updated print function

* Address PR comments
  • Loading branch information
hahmadia authored and johnweldon committed Nov 21, 2019
1 parent 158c9f9 commit 29be175
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ber.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,10 @@ func PrintBytes(out io.Writer, buf []byte, indent string) {
}
}

func WritePacket(out io.Writer, p *Packet) {
printPacket(out, p, 0, false)
}

func PrintPacket(p *Packet) {
printPacket(os.Stdout, p, 0, false)
}
Expand Down

0 comments on commit 29be175

Please sign in to comment.