func NewSender(url, subject string, natsOpts []nats.Option, opts ...SenderOption) (*Sender, error) {
	conn, err := nats.Connect(url, natsOpts...)
	if err != nil {
		return nil, err
	}
	s, err := NewSenderFromConn(conn, subject, opts...)
	if err != nil {
		conn.Close()
		return nil, err
	}
	s.connOwned = true
	return s, nil
}
NewSender creates a new protocol.Sender responsible for opening and closing the STAN connection
package nats
import (
	"bytes"
	"context"
	"fmt"
	"github.com/cloudevents/sdk-go/v2/binding"
	"github.com/cloudevents/sdk-go/v2/protocol"
	"github.com/nats-io/nats.go"
)
type Sender struct {
	Conn    *nats.Conn
	Subject string
	connOwned bool
}