MCPcopy
hub / github.com/AdguardTeam/dnsproxy / firstAddr

Function firstAddr

proxy/proxy.go:513–519  ·  view source on GitHub ↗

firstAddr returns the network address of the first entry in the given addressers or nil using the given addrFunc.

(addressers []A, af addrFunc[A])

Source from the content-addressed store, hash-verified

511// firstAddr returns the network address of the first entry in the given
512// addressers or nil using the given addrFunc.
513func firstAddr[A any](addressers []A, af addrFunc[A]) (addr net.Addr) {
514 if len(addressers) == 0 {
515 return nil
516 }
517
518 return af(addressers[0])
519}
520
521// Addr returns the first listen address for the specified proto or nil if the
522// proxy does not listen to it. proto must be one of [Proto]: [ProtoTCP],

Callers 1

AddrMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…