From d314d1f7e933ca83081eec289aa0cb6e75a7eeac Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Sun, 22 Mar 2026 17:33:27 +0000 Subject: objectstore{,/packed}: Document lifetime and integrity behavior --- objectstore/objectstore.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'objectstore/objectstore.go') diff --git a/objectstore/objectstore.go b/objectstore/objectstore.go index f152a7f0..c3de12a5 100644 --- a/objectstore/objectstore.go +++ b/objectstore/objectstore.go @@ -19,6 +19,9 @@ import ( var ErrObjectNotFound = errors.New("objectstore: object not found") // Store reads Git objects by object ID. +// +// Unless an implementation explicitly documents otherwise, values returned by +// Store methods are only valid until the store is closed. type Store interface { // ReadBytesFull reads a full serialized object as "type size\0content". // @@ -39,6 +42,7 @@ type Store interface { // ReadReaderFull reads a full serialized object stream as "type size\0content". // // Caller must close the returned reader. + // The returned reader is only valid until the store is closed. // // Any read-time integrity verification performed while producing the stream // is implementation-defined. @@ -48,6 +52,7 @@ type Store interface { // and content stream. // // Caller must close the returned reader. + // The returned reader is only valid until the store is closed. // // Any read-time integrity verification performed while producing the stream // is implementation-defined. -- cgit v1.3.1-10-gc9f91