Standard library / net/http/httptrace
httptrace.DNSDoneInfo
Carries Addrs, Err and Coalesced (whether lookup results were shared with another concurrent caller). Treat the address slice as read-only. This is synthetic event data. Expected stdout: '192.0.2.7 true true\n'.
Formal Syntax & Structure
go syntaxgo
type DNSDoneInfo struct { Addrs []net.IPAddr
Err error
Coalesced bool}Working Example
Example Snippetgo
package main
import ( "fmt" "net" "net/http/httptrace")
func main() { info := httptrace.DNSDoneInfo{Addrs: []net.IPAddr{{IP: net.ParseIP("192.0.2.7")}}, Coalesced: true} fmt.Println(info.Addrs[0].IP, info.Coalesced, info.Err == nil)}
func must[T any](v T, e error) T { if e != nil { panic(e) } return v}func check(e error) { if e != nil { panic(e) }}