mirror of
				https://github.com/yggdrasil-network/yggdrasil-go.git
				synced 2025-11-04 11:15:07 +03:00 
			
		
		
		
	Fix getRoutes (#339)
This commit is contained in:
		
							parent
							
								
									81aed4244c
								
							
						
					
					
						commit
						ad7e392afe
					
				
					 1 changed files with 10 additions and 6 deletions
				
			
		| 
						 | 
					@ -388,14 +388,18 @@ func main() {
 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
		case "getroutes":
 | 
							case "getroutes":
 | 
				
			||||||
			if _, ok := res["routes"]; !ok {
 | 
								if routes, ok := res["routes"].(map[string]interface{}); !ok {
 | 
				
			||||||
				fmt.Println("No routes found")
 | 
					 | 
				
			||||||
			} else if res["routes"] == nil {
 | 
					 | 
				
			||||||
				fmt.Println("No routes found")
 | 
									fmt.Println("No routes found")
 | 
				
			||||||
			} else {
 | 
								} else {
 | 
				
			||||||
				fmt.Println("Routes:")
 | 
									if res["routes"] == nil || len(routes) == 0 {
 | 
				
			||||||
				for _, v := range res["routes"].([]interface{}) {
 | 
										fmt.Println("No routes found")
 | 
				
			||||||
					fmt.Println("-", v)
 | 
									} else {
 | 
				
			||||||
 | 
										fmt.Println("Routes:")
 | 
				
			||||||
 | 
										for k, v := range routes {
 | 
				
			||||||
 | 
											if pv, ok := v.(string); ok {
 | 
				
			||||||
 | 
												fmt.Println("-", k, " via ", pv)
 | 
				
			||||||
 | 
											}
 | 
				
			||||||
 | 
										}
 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
		default:
 | 
							default:
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue