diff --git a/pkg/local_object_storage/blobovnicza/blobovnicza_test.go b/pkg/local_object_storage/blobovnicza/blobovnicza_test.go index 7e13d382b..37c8b5eb6 100644 --- a/pkg/local_object_storage/blobovnicza/blobovnicza_test.go +++ b/pkg/local_object_storage/blobovnicza/blobovnicza_test.go @@ -18,7 +18,7 @@ func testPutGet(t *testing.T, blz *Blobovnicza, addr oid.Address, sz uint64, ass data := make([]byte, sz) rand.Read(data) - pPut := new(PutPrm) + var pPut PutPrm pPut.SetAddress(addr) pPut.SetMarshaledObject(data) _, err := blz.Put(pPut) @@ -143,7 +143,7 @@ func TestIterateObjects(t *testing.T) { putPrm.SetAddress(oidtest.Address()) putPrm.SetMarshaledObject(v) - _, err := blz.Put(&putPrm) + _, err := blz.Put(putPrm) require.NoError(t, err) } diff --git a/pkg/local_object_storage/blobovnicza/get.go b/pkg/local_object_storage/blobovnicza/get.go index 66cc41f79..406f98a8b 100644 --- a/pkg/local_object_storage/blobovnicza/get.go +++ b/pkg/local_object_storage/blobovnicza/get.go @@ -24,7 +24,7 @@ func (p *GetPrm) SetAddress(addr oid.Address) { } // Object returns binary representation of the requested object. -func (p GetRes) Object() []byte { +func (p *GetRes) Object() []byte { return p.obj } diff --git a/pkg/local_object_storage/blobovnicza/iterate_test.go b/pkg/local_object_storage/blobovnicza/iterate_test.go index 94a6ebabf..d3dd37c14 100644 --- a/pkg/local_object_storage/blobovnicza/iterate_test.go +++ b/pkg/local_object_storage/blobovnicza/iterate_test.go @@ -19,7 +19,7 @@ func TestBlobovniczaIterate(t *testing.T) { data := [][]byte{{0, 1, 2, 3}, {5, 6, 7, 8}} addr := oidtest.Address() - _, err := b.Put(&PutPrm{addr: addr, objData: data[0]}) + _, err := b.Put(PutPrm{addr: addr, objData: data[0]}) require.NoError(t, err) require.NoError(t, b.boltDB.Update(func(tx *bbolt.Tx) error { diff --git a/pkg/local_object_storage/blobovnicza/put.go b/pkg/local_object_storage/blobovnicza/put.go index 16d490c9b..4ec369e6a 100644 --- a/pkg/local_object_storage/blobovnicza/put.go +++ b/pkg/local_object_storage/blobovnicza/put.go @@ -47,7 +47,7 @@ func (p *PutPrm) SetMarshaledObject(data []byte) { // Returns ErrFull if blobovnicza is filled. // // Should not be called in read-only configuration. -func (b *Blobovnicza) Put(prm *PutPrm) (*PutRes, error) { +func (b *Blobovnicza) Put(prm PutPrm) (*PutRes, error) { sz := uint64(len(prm.objData)) bucketName := bucketForSize(sz) key := addressKey(prm.addr) diff --git a/pkg/local_object_storage/blobstor/blobovnicza.go b/pkg/local_object_storage/blobstor/blobovnicza.go index dcf396eff..82aeecdd4 100644 --- a/pkg/local_object_storage/blobstor/blobovnicza.go +++ b/pkg/local_object_storage/blobstor/blobovnicza.go @@ -137,7 +137,7 @@ func indexSlice(number uint64) []uint64 { // // returns error if could not save object in any blobovnicza. func (b *blobovniczas) put(addr oid.Address, data []byte) (*blobovnicza.ID, error) { - prm := new(blobovnicza.PutPrm) + var prm blobovnicza.PutPrm prm.SetAddress(addr) prm.SetMarshaledObject(data) diff --git a/pkg/local_object_storage/shard/dump_test.go b/pkg/local_object_storage/shard/dump_test.go index 8aa268e81..b1c13c4be 100644 --- a/pkg/local_object_storage/shard/dump_test.go +++ b/pkg/local_object_storage/shard/dump_test.go @@ -363,7 +363,7 @@ func TestDumpIgnoreErrors(t *testing.T) { require.NoError(t, os.WriteFile(filepath.Join(bTree, "0", "2"), data, 0)) // 2.2. Invalid object in valid blobovnicza. - prm := new(blobovnicza.PutPrm) + var prm blobovnicza.PutPrm prm.SetAddress(oid.Address{}) prm.SetMarshaledObject(corruptedData) b := blobovnicza.New(blobovnicza.WithPath(filepath.Join(bTree, "1", "2")))