diff --git a/example_test.go b/example_test.go index c14792673..f8930dbaa 100644 --- a/example_test.go +++ b/example_test.go @@ -55,7 +55,7 @@ func (sd *skipTLSDialer) Dial(network, address string) (net.Conn, error) { } func (sd *skipTLSDialer) SkipTLSHandshake() bool { - return true + return sd.skipTLS } func ExampleCustomDialer() { @@ -74,7 +74,7 @@ func ExampleCustomDialer() { // return true // } // - sd := &skipTLSDialer{dialer: &net.Dialer{Timeout: 2 * time.Second}} + sd := &skipTLSDialer{dialer: &net.Dialer{Timeout: 2 * time.Second}, skipTLS: true} nc, _ := nats.Connect("demo.nats.io", nats.SetCustomDialer(sd)) defer nc.Close() }