summaryrefslogtreecommitdiffhomepage
path: root/iana/hwtypes.go
diff options
context:
space:
mode:
authorPablo Mazzini <pmazzini@gmail.com>2018-10-15 18:03:30 +0100
committerinsomniac <insomniacslk@users.noreply.github.com>2018-10-15 18:03:30 +0100
commitf1e31f7484231a7c51b57dba85abd174f043cc1e (patch)
tree16202b92256c50f9df255e9e76030dca674d089c /iana/hwtypes.go
parentd17d7ed73609154a9c72e1194a4ad4842447dde8 (diff)
Added String methods for types (#175)
Diffstat (limited to 'iana/hwtypes.go')
-rw-r--r--iana/hwtypes.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/iana/hwtypes.go b/iana/hwtypes.go
index 7467a78..075cded 100644
--- a/iana/hwtypes.go
+++ b/iana/hwtypes.go
@@ -78,3 +78,11 @@ var HwTypeToString = map[HwTypeType]string{
HwTypeWiegandInterface: "Wiegand Interface",
HwTypePureIP: "Pure IP",
}
+
+func (h HwTypeType) String() string {
+ hwtype := HwTypeToString[h]
+ if hwtype == "" {
+ hwtype = "Invalid"
+ }
+ return hwtype
+}