diff options
author | thomasmodeneis <thomas.modeneis@gmail.com> | 2018-04-18 06:53:50 +0800 |
---|---|---|
committer | Felix Lange <fjl@users.noreply.github.com> | 2018-04-18 06:53:50 +0800 |
commit | ba1030b6b84f810c04a82221a1b1c0a3dbf499a8 (patch) | |
tree | 9c3450535acddfec3b1987e0a2e04fa9ca303e38 /p2p/discv5/nodeevent_string.go | |
parent | 7605e63cb9dda7fc5bb619abf1eb1f74ac3f6cc1 (diff) | |
download | go-tangerine-ba1030b6b84f810c04a82221a1b1c0a3dbf499a8.tar go-tangerine-ba1030b6b84f810c04a82221a1b1c0a3dbf499a8.tar.gz go-tangerine-ba1030b6b84f810c04a82221a1b1c0a3dbf499a8.tar.bz2 go-tangerine-ba1030b6b84f810c04a82221a1b1c0a3dbf499a8.tar.lz go-tangerine-ba1030b6b84f810c04a82221a1b1c0a3dbf499a8.tar.xz go-tangerine-ba1030b6b84f810c04a82221a1b1c0a3dbf499a8.tar.zst go-tangerine-ba1030b6b84f810c04a82221a1b1c0a3dbf499a8.zip |
build: enable goimports and varcheck linters (#16446)
Diffstat (limited to 'p2p/discv5/nodeevent_string.go')
-rw-r--r-- | p2p/discv5/nodeevent_string.go | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/p2p/discv5/nodeevent_string.go b/p2p/discv5/nodeevent_string.go index eb696fb8b..38c1993ba 100644 --- a/p2p/discv5/nodeevent_string.go +++ b/p2p/discv5/nodeevent_string.go @@ -4,24 +4,14 @@ package discv5 import "strconv" -const ( - _nodeEvent_name_0 = "invalidEventpingPacketpongPacketfindnodePacketneighborsPacketfindnodeHashPackettopicRegisterPackettopicQueryPackettopicNodesPacket" - _nodeEvent_name_1 = "pongTimeoutpingTimeoutneighboursTimeout" -) +const _nodeEvent_name = "pongTimeoutpingTimeoutneighboursTimeout" -var ( - _nodeEvent_index_0 = [...]uint8{0, 12, 22, 32, 46, 61, 79, 98, 114, 130} - _nodeEvent_index_1 = [...]uint8{0, 11, 22, 39} -) +var _nodeEvent_index = [...]uint8{0, 11, 22, 39} func (i nodeEvent) String() string { - switch { - case 0 <= i && i <= 8: - return _nodeEvent_name_0[_nodeEvent_index_0[i]:_nodeEvent_index_0[i+1]] - case 265 <= i && i <= 267: - i -= 265 - return _nodeEvent_name_1[_nodeEvent_index_1[i]:_nodeEvent_index_1[i+1]] - default: - return "nodeEvent(" + strconv.FormatInt(int64(i), 10) + ")" + i -= 264 + if i >= nodeEvent(len(_nodeEvent_index)-1) { + return "nodeEvent(" + strconv.FormatInt(int64(i+264), 10) + ")" } + return _nodeEvent_name[_nodeEvent_index[i]:_nodeEvent_index[i+1]] } |