code: func (t *TxStateChange) CheckAndSet() {
  	t.c.txStateMu.Lock()
  	defer t.c.txStateMu.Unlock()
  	defer func() { t.done = true }()
  
  	if t.done {
  		panic("CheckAndSet should only be called once")
  	}
  
  	if !t.tx && t.c.TransactionActive() && t.c.TxStartedAt.IsZero() {
  		t.c.TxStartedAt = time.Now()
  	} else if t.tx && !t.c.TransactionActive() && !t.c.TxStartedAt.IsZero() {
  		t.c.TxStartedAt = time.Time{}
  	}
  }
docs: // CheckAndSet sets whether a transaction has begun or ended on the
  // connection since the TxStateChange was created. Once CheckAndSet
  // has been called, this function will panic if called a second time.