github.com/yinchengtsinghua/golang-Eos-dpos-Ethereum@v0.0.0-20190121132951-92cc4225ed8e/p2p/discv5/nodeevent_string.go (about)

     1  
     2  //此源码被清华学神尹成大魔王专业翻译分析并修改
     3  //尹成QQ77025077
     4  //尹成微信18510341407
     5  //尹成所在QQ群721929980
     6  //尹成邮箱 yinc13@mails.tsinghua.edu.cn
     7  //尹成毕业于清华大学,微软区块链领域全球最有价值专家
     8  //https://mvp.microsoft.com/zh-cn/PublicProfile/4033620
     9  //由“stringer-type=nodeEvent”生成的代码;不要编辑。
    10  
    11  package discv5
    12  
    13  import "strconv"
    14  
    15  const _nodeEvent_name = "pongTimeoutpingTimeoutneighboursTimeout"
    16  
    17  var _nodeEvent_index = [...]uint8{0, 11, 22, 39}
    18  
    19  func (i nodeEvent) String() string {
    20  	i -= 264
    21  	if i >= nodeEvent(len(_nodeEvent_index)-1) {
    22  		return "nodeEvent(" + strconv.FormatInt(int64(i+264), 10) + ")"
    23  	}
    24  	return _nodeEvent_name[_nodeEvent_index[i]:_nodeEvent_index[i+1]]
    25  }