Skip to content

Commit

Permalink
Cleanup code, protocol names are not needed
Browse files Browse the repository at this point in the history
  • Loading branch information
monicasarbu committed Apr 14, 2015
1 parent 3e497de commit bec51f5
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 34 deletions.
17 changes: 0 additions & 17 deletions protos/protos.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
17 changes: 0 additions & 17 deletions protos/protos_test.go
Original file line number Diff line number Diff line change
@@ -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())
}

0 comments on commit bec51f5

Please sign in to comment.