From debc14cea3b00aeecdda1aa1621c62b64170b68a Mon Sep 17 00:00:00 2001 From: mappu Date: Sun, 3 Apr 2016 18:53:14 +1200 Subject: [PATCH] libnmdc: isolate constants --- src/libnmdc/libnmdc.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/libnmdc/libnmdc.go b/src/libnmdc/libnmdc.go index bee3a6b..427517c 100644 --- a/src/libnmdc/libnmdc.go +++ b/src/libnmdc/libnmdc.go @@ -12,6 +12,11 @@ import ( "time" ) +const ( + DEFAULT_CLIENT_TAG string = "libnmdc.go" + DEFAULT_HUB_NAME string = "(unknown)" +) + type ConnectionState int type HubEventType int @@ -401,12 +406,12 @@ func (this *HubConnection) worker() { func (this *HubConnectionOptions) prepareConnection() *HubConnection { if this.Self.ClientTag == "" { - this.Self.ClientTag = "libnmdc.go" + this.Self.ClientTag = DEFAULT_CLIENT_TAG } hc := HubConnection{ Hco: this, - HubName: "(unknown)", + HubName: DEFAULT_HUB_NAME, State: CONNECTIONSTATE_DISCONNECTED, Users: make(map[string]UserInfo), }