From 83744f5d7068c4af05783a5c8ce3851b24c4452d Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Sat, 27 Jun 2015 23:26:45 +0200 Subject: Rename Identifier to Kind --- ber/class.go | 14 +++++++------- ber/class_test.go | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) (limited to 'ber') diff --git a/ber/class.go b/ber/class.go index c2e31b6..b3a0ebf 100644 --- a/ber/class.go +++ b/ber/class.go @@ -22,23 +22,23 @@ var classNames = map[Class]string{ func (c Class) String() string { return classNames[c] } -type Identifier byte +type Kind byte const ( - Primitive Identifier = iota << 5 + Primitive Kind = iota << 5 Constructed ) // 0010 0000 // 2 0 -const IdentifierMask Identifier = 1 << 5 +const KindMask Kind = 1 << 5 -var identifierNames = map[Identifier]string{ +var kindNames = map[Kind]string{ Primitive: "Primitive", Constructed: "Constructed", } -func (i Identifier) String() string { return identifierNames[i] } +func (k Kind) String() string { return kindNames[k] } type Tag byte @@ -114,8 +114,8 @@ var tagNames = map[Tag]string{ func (t Tag) String() string { return tagNames[t] } -func Ident(b byte) (Class, Identifier, Tag) { +func Ident(b byte) (Class, Kind, Tag) { return Class(b) & ClassMask, - Identifier(b) & IdentifierMask, + Kind(b) & KindMask, Tag(b) & TagMask } diff --git a/ber/class_test.go b/ber/class_test.go index 8e9a49a..a7b8e1d 100644 --- a/ber/class_test.go +++ b/ber/class_test.go @@ -5,8 +5,8 @@ import "fmt" func ExampleIdent() { b := []byte{0x60, 0xA1, 0x02, 0x30, 0x0A, 0x80, 0x7E, 0x04} for _, v := range b { - c, i, t := Ident(v) - fmt.Printf("0x%.2X: %v %v %v - 0x%.2X\n", v, c, i, t, byte(t)) + c, k, t := Ident(v) + fmt.Printf("0x%.2X: %v %v %v - 0x%.2X\n", v, c, k, t, byte(t)) } // Output: // 0x60: Application Constructed End-of-Content - 0x00 -- cgit v1.2.3