From dc3d77dacc8918eaabcea2df3d196a8ecce3802d Mon Sep 17 00:00:00 2001 From: Michael Eischer Date: Sun, 13 Feb 2022 00:05:14 +0100 Subject: [PATCH] repository: make saveAndEncrypt private --- internal/repository/repository.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/repository/repository.go b/internal/repository/repository.go index 2bd03937e..32583ad15 100644 --- a/internal/repository/repository.go +++ b/internal/repository/repository.go @@ -252,10 +252,10 @@ func (r *Repository) LookupBlobSize(id restic.ID, tpe restic.BlobType) (uint, bo return r.idx.LookupSize(restic.BlobHandle{ID: id, Type: tpe}) } -// SaveAndEncrypt encrypts data and stores it to the backend as type t. If data +// saveAndEncrypt encrypts data and stores it to the backend as type t. If data // is small enough, it will be packed together with other small blobs. // The caller must ensure that the id matches the data. -func (r *Repository) SaveAndEncrypt(ctx context.Context, t restic.BlobType, data []byte, id restic.ID) error { +func (r *Repository) saveAndEncrypt(ctx context.Context, t restic.BlobType, data []byte, id restic.ID) error { debug.Log("save id %v (%v, %d bytes)", id, t, len(data)) nonce := crypto.NewRandomNonce() @@ -698,7 +698,7 @@ func (r *Repository) SaveBlob(ctx context.Context, t restic.BlobType, buf []byte // only save when needed or explicitly told if !known || storeDuplicate { - err = r.SaveAndEncrypt(ctx, t, buf, newID) + err = r.saveAndEncrypt(ctx, t, buf, newID) } return newID, known, err