Implement fmt.Formatter to display all stat information. Now you don't need to write each stats one by one. Just use %+v and it outputs all information,
fmt.Printf("%+v\n", result)
Output,
DNS lookup: 461 ms
TCP connection: 163 ms
TLS handshake: 427 ms
Server processing: 165 ms
Content transfer: 0 ms
Name Lookup: 461 ms
Connect: 624 ms
Pre Transfer: 1052 ms
Start Transfer: 1218 ms
Total: 1218 ms
Implement
fmt.Formatter
to display all stat information. Now you don't need to write each stats one by one. Just use%+v
and it outputs all information,Output,