aboutsummaryrefslogtreecommitdiff
path: root/ber/obj.go
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2015-06-27 15:03:22 +0200
committerDimitri Sokolyuk <demon@dim13.org>2015-06-27 15:03:22 +0200
commit35611186639bd1632ae4be124133f866ab6a2107 (patch)
treec89b35c02f62b541d973555b0f0b13f235d3bed8 /ber/obj.go
parent6b6c369b624b9ddccd9a23eed78e0340db99ad85 (diff)
Isolate reflect
Diffstat (limited to 'ber/obj.go')
-rw-r--r--ber/obj.go8
1 files changed, 5 insertions, 3 deletions
diff --git a/ber/obj.go b/ber/obj.go
index ff8aef8..5482cd1 100644
--- a/ber/obj.go
+++ b/ber/obj.go
@@ -1,5 +1,7 @@
package ber
+type Obj []int
+
func base128(n int) (b []byte) {
if n == 0 {
return []byte{0}
@@ -23,7 +25,7 @@ func debase128(b []byte) int {
return 0
}
-func marshalObj(obj []int) (b []byte) {
+func marshalObj(obj Obj) (b []byte) {
if len(obj) < 2 || obj[0] > 2 {
return []byte{}
}
@@ -38,6 +40,6 @@ func marshalObj(obj []int) (b []byte) {
return b
}
-func unmarshalObj(b []byte) []int {
- return []int{}
+func unmarshalObj(b []byte) Obj {
+ return Obj{}
}