Standard library / net/http/httptrace

httptrace.DNSStartInfo

Carries Host, the name about to be resolved. The example constructs synthetic callback data, not a DNS lookup. Expected stdout: 'demo.invalid\n'.

Formal Syntax & Structure

go syntaxgo
type DNSStartInfo struct {  Host string}

Working Example

Example Snippetgo
package main
import (  "fmt"  "net/http/httptrace")
func main() { info := httptrace.DNSStartInfo{Host: "demo.invalid"}; fmt.Println(info.Host) }
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)  }}
Go Reference