From 54caa4e7e085e177ff05b719ae247d21fe8c257e Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Sat, 26 Sep 2015 12:04:34 +0200 Subject: Replace with new implementation --- ber/new/dump.go | 40 ---------------------------------------- 1 file changed, 40 deletions(-) delete mode 100644 ber/new/dump.go (limited to 'ber/new/dump.go') diff --git a/ber/new/dump.go b/ber/new/dump.go deleted file mode 100644 index 330bc7a..0000000 --- a/ber/new/dump.go +++ /dev/null @@ -1,40 +0,0 @@ -package ber - -import ( - "fmt" -) - -func Dump(b []byte) string { - return newState(b).dump(0) -} - -func (s *state) dump(indent int) string { - if s.Len() == 0 { - return "" - } - //fmt.Printf("%*s%x %x\n", 2*indent, "", s.Len(), s.Bytes()) - for s.Len() > 0 { - h := s.ident() - fmt.Printf("%*s%v: ", 2*indent, "", h) - if h.Class == classUniversal && h.Kind == kindPrimitive { - switch h.Tag { - case tagInteger, tagEnumerated: - fmt.Println(s.unmarshalInt()) - case tagBoolean: - fmt.Println(s.unmarshalBool()) - case tagObjectIdentifier: - fmt.Println(s.unmarshalOID()) - case tagBitString: - fmt.Println(s.unmarshalBitString()) - case tagIA5String, tagOctetString: - fmt.Println(s.unmarshalString()) - default: - fmt.Println(s.next()) - } - } else { - fmt.Println("→") - s.subState().dump(indent + 1) - } - } - return s.dump(indent) -} -- cgit v1.2.3