From e8fa791c894265f3c4f7e08b656ef31a877d3fe6 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Sun, 28 Feb 2016 01:08:42 -0800 Subject: [PATCH] Make the debug string function public, so that the pxe package can use it. --- dhcp/dhcp.go | 3 ++- dhcp/dhcp_test.go | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/dhcp/dhcp.go b/dhcp/dhcp.go index 445f8f2..e33415c 100644 --- a/dhcp/dhcp.go +++ b/dhcp/dhcp.go @@ -69,7 +69,8 @@ type Packet struct { Options Options } -func (p *Packet) testString() string { +// DebugString prints the contents of a DHCP packet for human consumption. +func (p *Packet) DebugString() string { var b bytes.Buffer bcast := "Unicast" if p.Broadcast { diff --git a/dhcp/dhcp_test.go b/dhcp/dhcp_test.go index 4dc4262..3f29398 100644 --- a/dhcp/dhcp_test.go +++ b/dhcp/dhcp_test.go @@ -54,7 +54,7 @@ func TestParse(t *testing.T) { if err != nil { t.Fatalf("Parsing DHCP packet #%d: %s", i+1, err) } - pkts.WriteString(pkt.testString()) + pkts.WriteString(pkt.DebugString()) pkts.WriteString("======\n") }