From 29be175fc3a3b1787c008093b829fbfee40decd6 Mon Sep 17 00:00:00 2001 From: Hossein Ahmadian-Yazdi Date: Thu, 21 Nov 2019 16:21:51 -0500 Subject: [PATCH] Update Print Function to Accept io.Writer and not use os.StdOut by default (#24) * Updated print function * Address PR comments --- ber.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ber.go b/ber.go index 6153f46..b89c7f4 100644 --- a/ber.go +++ b/ber.go @@ -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) }