e071084ebe
govulncheck / govulncheck (push) Waiting to run
Harness (E2E) / Harnesses (mock LLM) (push) Waiting to run
Harness (E2E) / Provider harnesses (live LLM conformance) (push) Waiting to run
Lint / golangci-lint (push) Waiting to run
Run Tests / Unit Tests (push) Waiting to run
Run Tests / Etcd Integration Tests (push) Waiting to run
21 lines
319 B
Go
21 lines
319 B
Go
package transport
|
|
|
|
import (
|
|
"net"
|
|
)
|
|
|
|
type netListener struct{}
|
|
|
|
// getNetListener Get net.Listener from ListenOptions.
|
|
func getNetListener(o *ListenOptions) net.Listener {
|
|
if o.Context == nil {
|
|
return nil
|
|
}
|
|
|
|
if l, ok := o.Context.Value(netListener{}).(net.Listener); ok && l != nil {
|
|
return l
|
|
}
|
|
|
|
return nil
|
|
}
|