From bec51f57fe9623b1c007316fb227c328ba0310d1 Mon Sep 17 00:00:00 2001 From: Monica Sarbu Date: Tue, 14 Apr 2015 09:07:55 +0200 Subject: [PATCH] Cleanup code, protocol names are not needed --- protos/protos.go | 17 ----------------- protos/protos_test.go | 17 ----------------- 2 files changed, 34 deletions(-) diff --git a/protos/protos.go b/protos/protos.go index 3cfed55cb6a..36837aaea6a 100644 --- a/protos/protos.go +++ b/protos/protos.go @@ -53,23 +53,6 @@ const ( ThriftProtocol ) -// Protocol names -var ProtocolNames = []string{ - "unknown", - "http", - "mysql", - "redis", - "pgsql", - "thrift", -} - -func (p Protocol) String() string { - if int(p) >= len(ProtocolNames) { - return "impossible" - } - return ProtocolNames[p] -} - // list of protocol plugins type Protocols struct { protos map[Protocol]ProtocolPlugin diff --git a/protos/protos_test.go b/protos/protos_test.go index ba12bef9402..cb5a9890096 100644 --- a/protos/protos_test.go +++ b/protos/protos_test.go @@ -1,18 +1 @@ package protos - -import ( - "testing" - - "github.com/stretchr/testify/assert" -) - -func TestProtocolNames(t *testing.T) { - assert.Equal(t, "unknown", UnknownProtocol.String()) - assert.Equal(t, "http", HttpProtocol.String()) - assert.Equal(t, "mysql", MysqlProtocol.String()) - assert.Equal(t, "redis", RedisProtocol.String()) - assert.Equal(t, "pgsql", PgsqlProtocol.String()) - assert.Equal(t, "thrift", ThriftProtocol.String()) - - assert.Equal(t, "impossible", Protocol(100).String()) -}