Skip to content

Commit 7be9edb

Browse files
committed
batch: document FormatMajorVersion responsibility on SetRepr
1 parent 615cb41 commit 7be9edb

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

batch.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1324,6 +1324,10 @@ func (b *Batch) Repr() []byte {
13241324
//
13251325
// SetRepr may return ErrInvalidBatch if the supplied slice fails to decode in
13261326
// any way. It will not return an error in any other circumstance.
1327+
//
1328+
// The caller is responsible for ensuring that the batch is applied to a DB at
1329+
// a FormatMajorVersion that supports all of the operation kinds encoded in the
1330+
// supplied slice.
13271331
func (b *Batch) SetRepr(data []byte) error {
13281332
h, ok := batchrepr.ReadHeader(data)
13291333
if !ok {

0 commit comments

Comments
 (0)