mirror of
				https://github.com/yggdrasil-network/yggdrasil-go.git
				synced 2025-11-04 03:05:07 +03:00 
			
		
		
		
	cleanup/fixes from go vet
This commit is contained in:
		
							parent
							
								
									12cc7fc639
								
							
						
					
					
						commit
						6d0e40045a
					
				
					 3 changed files with 2 additions and 6 deletions
				
			
		| 
						 | 
					@ -456,7 +456,6 @@ func (n *admin_nodeInfo) toString() string {
 | 
				
			||||||
		out = append(out, fmt.Sprintf("%v: %v", p.key, p.val))
 | 
							out = append(out, fmt.Sprintf("%v: %v", p.key, p.val))
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	return strings.Join(out, ", ")
 | 
						return strings.Join(out, ", ")
 | 
				
			||||||
	return fmt.Sprint(*n)
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// printInfos returns a newline separated list of strings from admin_nodeInfos, e.g. a printable string of info about all peers.
 | 
					// printInfos returns a newline separated list of strings from admin_nodeInfos, e.g. a printable string of info about all peers.
 | 
				
			||||||
| 
						 | 
					@ -597,7 +596,7 @@ func (a *admin) getData_getSwitchPeers() []admin_nodeInfo {
 | 
				
			||||||
// getData_getSwitchQueues returns info from Core.switchTable for an queue data.
 | 
					// getData_getSwitchQueues returns info from Core.switchTable for an queue data.
 | 
				
			||||||
func (a *admin) getData_getSwitchQueues() admin_nodeInfo {
 | 
					func (a *admin) getData_getSwitchQueues() admin_nodeInfo {
 | 
				
			||||||
	var peerInfos admin_nodeInfo
 | 
						var peerInfos admin_nodeInfo
 | 
				
			||||||
	switchTable := a.core.switchTable
 | 
						switchTable := &a.core.switchTable
 | 
				
			||||||
	getSwitchQueues := func() {
 | 
						getSwitchQueues := func() {
 | 
				
			||||||
		queues := make([]map[string]interface{}, 0)
 | 
							queues := make([]map[string]interface{}, 0)
 | 
				
			||||||
		for k, v := range switchTable.queues.bufs {
 | 
							for k, v := range switchTable.queues.bufs {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -200,8 +200,6 @@ func (c *cryptokey) addRoute(cidr string, dest string) error {
 | 
				
			||||||
		c.core.log.Println("Added CKR destination subnet", cidr)
 | 
							c.core.log.Println("Added CKR destination subnet", cidr)
 | 
				
			||||||
		return nil
 | 
							return nil
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					 | 
				
			||||||
	return errors.New("Unspecified error")
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Looks up the most specific route for the given address (with the address
 | 
					// Looks up the most specific route for the given address (with the address
 | 
				
			||||||
| 
						 | 
					@ -332,7 +330,7 @@ func (c *cryptokey) removeRoute(cidr string, dest string) error {
 | 
				
			||||||
			for k := range *routingcache {
 | 
								for k := range *routingcache {
 | 
				
			||||||
				delete(*routingcache, k)
 | 
									delete(*routingcache, k)
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
			c.core.log.Println("Removed CKR destination subnet %s via %s", cidr, dest)
 | 
								c.core.log.Printf("Removed CKR destination subnet %s via %s\n", cidr, dest)
 | 
				
			||||||
			return nil
 | 
								return nil
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -102,7 +102,6 @@ func (t *dht) insert(info *dhtInfo) {
 | 
				
			||||||
	if *info.getNodeID() == t.nodeID {
 | 
						if *info.getNodeID() == t.nodeID {
 | 
				
			||||||
		// This shouldn't happen, but don't add it if it does
 | 
							// This shouldn't happen, but don't add it if it does
 | 
				
			||||||
		return
 | 
							return
 | 
				
			||||||
		panic("FIXME")
 | 
					 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	info.recv = time.Now()
 | 
						info.recv = time.Now()
 | 
				
			||||||
	if oldInfo, isIn := t.table[*info.getNodeID()]; isIn {
 | 
						if oldInfo, isIn := t.table[*info.getNodeID()]; isIn {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue