config := &tls.Config{ ServerName: "example.com", }
config := &tls.Config{ ServerName: "localhost", InsecureSkipVerify: true, }In this example, a new `tls.Config` struct is created with the `ServerName` field set to `localhost` and the `InsecureSkipVerify` field set to `true`. This configuration is used to establish a TLS connection with a local server that may not have a valid certificate. This is not recommended in production environments, as it can leave the connection vulnerable to man-in-the-middle attacks. The package library used in these examples is `crypto/tls`.