func (p *PostgresStore) StopCleanup() {
	if p.stopCleanup != nil {
		p.stopCleanup <- true
	}
}
StopCleanup terminates the background cleanup goroutine for the PostgresStore
instance. It's rare to terminate this; generally PostgresStore instances and
their cleanup goroutines are intended to be long-lived and run for the lifetime
of your application.

There may be occasions though when your use of the PostgresStore is transient.
An example is creating a new PostgresStore instance in a test function. In this
scenario, the cleanup goroutine (which will run forever) will prevent the
PostgresStore object from being garbage collected even after the test function
has finished. You can prevent this by manually calling StopCleanup.
package pgxstore
import (
	"context"
	"log"
	"time"
	"github.com/jackc/pgx/v4"
	"github.com/jackc/pgx/v4/pgxpool"
)
type PostgresStore struct {
	pool        *pgxpool.Pool
	stopCleanup chan bool
}
func New(pool *pgxpool.Pool) *PostgresStore {
	return NewWithCleanupInterval(pool, 5*time.Minute)
}
func NewWithCleanupInterval(pool *pgxpool.Pool, cleanupInterval time.Duration) *PostgresStore {
	p := &PostgresStore{pool: pool}
	if cleanupInterval > 0 {
		go p.startCleanup(cleanupInterval)
	}
	return p
}
func (p *PostgresStore) Find(token string) (b []byte, exists bool, err error) {
	row := p.pool.QueryRow(context.Background(), "SELECT data FROM sessions WHERE token = $1 AND current_timestamp < expiry", token)
	err = row.Scan(&b)
	if err == pgx.ErrNoRows {
		return nil, false, nil
	} else if err != nil {
		return nil, false, err
	}
	return b, true, nil
}
func (p *PostgresStore) Commit(token string, b []byte, expiry time.Time) error {
	_, err := p.pool.Exec(context.Background(), "INSERT INTO sessions (token, data, expiry) VALUES ($1, $2, $3) ON CONFLICT (token) DO UPDATE SET data = EXCLUDED.data, expiry = EXCLUDED.expiry", token, b, expiry)
	if err != nil {
		return err
	}
	return nil
}
func (p *PostgresStore) Delete(token string) error {
	_, err := p.pool.Exec(context.Background(), "DELETE FROM sessions WHERE token = $1", token)
	return err
}
func (p *PostgresStore) startCleanup(interval time.Duration) {
	p.stopCleanup = make(chan bool)
	ticker := time.NewTicker(interval)
	for {
		select {
		case <-ticker.C:
			err := p.deleteExpired()
			if err != nil {
				log.Println(err)
			}
		case <-p.stopCleanup:
			ticker.Stop()
			return
		}
	}
}