aboutsummaryrefslogtreecommitdiff
path: root/ber/new/class.go
diff options
context:
space:
mode:
Diffstat (limited to 'ber/new/class.go')
-rw-r--r--ber/new/class.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/ber/new/class.go b/ber/new/class.go
index 7e4bfd3..f0bdff8 100644
--- a/ber/new/class.go
+++ b/ber/new/class.go
@@ -1,5 +1,7 @@
package ber
+import "fmt"
+
type Header struct {
Class
Kind
@@ -123,3 +125,11 @@ func (s *state) ident() Header {
Tag: tag,
}
}
+
+func (h Header) String() string {
+ f := "%v %v %v"
+ if h.Kind != kindPrimitive {
+ f = "%v %v %d"
+ }
+ return fmt.Sprintf(f, h.Class, h.Kind, h.Tag)
+}