func (l *Lock) IsExpired() bool {
	if l == nil {
		return true
	}
	l.semaphore.Lock()
	defer l.semaphore.Unlock()
	return l.isExpired()
}
IsExpired returns if the lock is expired, released, or neither.
package dynamolock
import (
	"errors"
	"sync"
	"time"
	"github.com/aws/aws-sdk-go/service/dynamodb"
)
type Lock struct {
	semaphore sync.Mutex
	client       *Client
	partitionKey string
	data                []byte
	ownerName           string
	deleteLockOnRelease bool
	isReleased          bool
	sessionMonitor      *sessionMonitor
	lookupTime           time.Time
	recordVersionNumber  string
	leaseDuration        time.Duration
	additionalAttributes map[string]*dynamodb.AttributeValue
}
func (l *Lock) Data() []byte {
	if l == nil {
		return nil
	}
	return l.data
}
func (l *Lock) Close() error {
	if l != nil && l.client != nil {
		if l.IsExpired() {
			return ErrLockAlreadyReleased
		}
		_, err := l.client.ReleaseLock(l)
		return err
	}
	return ErrCannotReleaseNullLock
}
func (l *Lock) uniqueIdentifier() string {
	return l.partitionKey
}