func cleanupBookmarks(bookmarks []string) []string {
	hasBad := false
	for _, b := range bookmarks {
		if len(b) == 0 {
			hasBad = true
			break
		}
	}
	if !hasBad {
		return bookmarks
	}
	cleaned := make([]string, 0, len(bookmarks)-1)
	for _, b := range bookmarks {
		if len(b) > 0 {
			cleaned = append(cleaned, b)
		}
	}
	return cleaned
}
Remove empty string bookmarks to check for "bad" callers
To avoid allocating, first check if this is a problem
package neo4j
import (
	"context"
	"time"
	"github.com/neo4j/neo4j-go-driver/v4/neo4j/db"
	"github.com/neo4j/neo4j-go-driver/v4/neo4j/internal/retry"
	"github.com/neo4j/neo4j-go-driver/v4/neo4j/log"
)
type TransactionWork func(tx Transaction) (interface{}, error)
type Session interface {
	LastBookmark() string
	BeginTransaction(configurers ...func(*TransactionConfig)) (Transaction, error)
	ReadTransaction(work TransactionWork, configurers ...func(*TransactionConfig)) (interface{}, error)
	WriteTransaction(work TransactionWork, configurers ...func(*TransactionConfig)) (interface{}, error)
	Run(cypher string, params map[string]interface{}, configurers ...func(*TransactionConfig)) (Result, error)
	Close() error
}
type SessionConfig struct {
	AccessMode AccessMode
	Bookmarks []string
	DatabaseName string
	FetchSize int
	BoltLogger log.BoltLogger
}
const FetchAll = -1
const FetchDefault = 0
type sessionPool interface {
	Borrow(ctx context.Context, serverNames []string, wait bool, boltLogger log.BoltLogger) (db.Connection, error)
	Return(c db.Connection)
	CleanUp()
}
type session struct {
	config       *Config
	defaultMode  db.AccessMode
	bookmarks    []string
	databaseName string
	pool         sessionPool
	router       sessionRouter
	txExplicit   *transaction
	txAuto       *autoTransaction
	sleep        func(d time.Duration)
	now          func() time.Time
	logId        string
	log          log.Logger
	throttleTime time.Duration
	fetchSize    int
	boltLogger   log.BoltLogger
}