aboutsummaryrefslogtreecommitdiff
path: root/ber/class.go
diff options
context:
space:
mode:
Diffstat (limited to 'ber/class.go')
-rw-r--r--ber/class.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/ber/class.go b/ber/class.go
index 50ada25..5cc0603 100644
--- a/ber/class.go
+++ b/ber/class.go
@@ -114,9 +114,10 @@ var tagNames = map[Tag]string{
func (t Tag) String() string { return tagNames[t] }
func (h Header) String() string {
- f := "%v %v %v"
- if h.Class != classUniversal {
- f = "%v %v %d"
+ switch h.Class {
+ case classUniversal:
+ return fmt.Sprint(h.Tag)
+ default:
+ return fmt.Sprintf("%v %d", h.Class, h.Tag)
}
- return fmt.Sprintf(f, h.Class, h.Kind, h.Tag)
}