MCPcopy Index your code
hub / github.com/coder/coder / PingClient

Function PingClient

coderd/notifications/dispatch/smtptest/server.go:225–239  ·  view source on GitHub ↗
(listen net.Listener, useTLS bool, startTLS bool)

Source from the content-addressed store, hash-verified

223}
224
225func PingClient(listen net.Listener, useTLS bool, startTLS bool) (*smtp.Client, error) {
226 tlsCfg := &tls.Config{
227 // nolint:gosec // It's a test.
228 InsecureSkipVerify: true,
229 }
230
231 switch {
232 case useTLS:
233 return smtp.DialTLS(listen.Addr().String(), tlsCfg)
234 case startTLS:
235 return smtp.DialStartTLS(listen.Addr().String(), tlsCfg)
236 default:
237 return smtp.Dial(listen.Addr().String())
238 }
239}

Callers 3

TestSMTPFunction · 0.92

Calls 3

DialMethod · 0.65
StringMethod · 0.45
AddrMethod · 0.45

Tested by 3

TestSMTPFunction · 0.74