Add IPv4 address column to output table

- Added IPv4 endpoint address as a new column in the results table
- Adjusted column formatting to accommodate the new 15-character wide column
- Makes it easier to see which IP addresses correspond to each relay
This commit is contained in:
Jeffrey Paul 2025-07-14 05:40:09 -07:00
parent 7652472953
commit 64101b1dfd

View File

@ -186,13 +186,14 @@ func PrintRelayLatencies(relayLatencies []RelayLatency, totalRelays int, deadRel
fmt.Println() fmt.Println()
} }
fmt.Printf("%-20s %-20s %-30s %s\n", "Country", "City", "Hostname", "Latency") fmt.Printf("%-20s %-20s %-30s %-15s %s\n", "Country", "City", "Hostname", "IPv4 Address", "Latency")
for i, rl := range relayLatencies { for i, rl := range relayLatencies {
if i < 25 || i >= len(relayLatencies)-4 { if i < 25 || i >= len(relayLatencies)-4 {
fmt.Printf("%-20s %-20s %-30s %v\n", fmt.Printf("%-20s %-20s %-30s %-15s %v\n",
rl.Relay.Location.Country, rl.Relay.Location.Country,
rl.Relay.Location.City, rl.Relay.Location.City,
rl.Relay.Hostname, rl.Relay.Hostname,
rl.Relay.Ipv4AddrIn,
rl.Latency) rl.Latency)
} }
if i == 24 { if i == 24 {