@@ -49,7 +49,7 @@ func (t *TxStructure) RPush(key []byte, values ...[]byte) error {
49
49
50
50
func (t * TxStructure ) listPush (key []byte , left bool , values ... []byte ) error {
51
51
if t .readWriter == nil {
52
- return errWriteOnSnapshot
52
+ return ErrWriteOnSnapshot
53
53
}
54
54
if len (values ) == 0 {
55
55
return nil
@@ -92,7 +92,7 @@ func (t *TxStructure) RPop(key []byte) ([]byte, error) {
92
92
93
93
func (t * TxStructure ) listPop (key []byte , left bool ) ([]byte , error ) {
94
94
if t .readWriter == nil {
95
- return nil , errWriteOnSnapshot
95
+ return nil , ErrWriteOnSnapshot
96
96
}
97
97
metaKey := t .encodeListMetaKey (key )
98
98
meta , err := t .loadListMeta (metaKey )
@@ -176,7 +176,7 @@ func (t *TxStructure) LIndex(key []byte, index int64) ([]byte, error) {
176
176
// LSet updates an element in the list by its index.
177
177
func (t * TxStructure ) LSet (key []byte , index int64 , value []byte ) error {
178
178
if t .readWriter == nil {
179
- return errWriteOnSnapshot
179
+ return ErrWriteOnSnapshot
180
180
}
181
181
metaKey := t .encodeListMetaKey (key )
182
182
meta , err := t .loadListMeta (metaKey )
@@ -189,13 +189,13 @@ func (t *TxStructure) LSet(key []byte, index int64, value []byte) error {
189
189
if index >= meta .LIndex && index < meta .RIndex {
190
190
return t .readWriter .Set (t .encodeListDataKey (key , index ), value )
191
191
}
192
- return errInvalidListIndex .GenWithStack ("invalid list index %d" , index )
192
+ return ErrInvalidListIndex .GenWithStack ("invalid list index %d" , index )
193
193
}
194
194
195
195
// LClear removes the list of the key.
196
196
func (t * TxStructure ) LClear (key []byte ) error {
197
197
if t .readWriter == nil {
198
- return errWriteOnSnapshot
198
+ return ErrWriteOnSnapshot
199
199
}
200
200
metaKey := t .encodeListMetaKey (key )
201
201
meta , err := t .loadListMeta (metaKey )
@@ -228,7 +228,7 @@ func (t *TxStructure) loadListMeta(metaKey []byte) (listMeta, error) {
228
228
}
229
229
230
230
if len (v ) != 16 {
231
- return meta , errInvalidListMetaData
231
+ return meta , ErrInvalidListMetaData
232
232
}
233
233
234
234
meta .LIndex = int64 (binary .BigEndian .Uint64 (v [0 :8 ]))
0 commit comments