Skip to content

Commit

Permalink
linter: Suppress staticcheck - using deprecation
Browse files Browse the repository at this point in the history
Signed-off-by: Evgenii Baidakov <[email protected]>
  • Loading branch information
smallhive committed Sep 22, 2023
1 parent b652067 commit ad5f693
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions storagegroup/storagegroup.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ func (sg *StorageGroup) SetValidationDataHash(hash checksum.Checksum) {
// See also SetExpirationEpoch.
func (sg StorageGroup) ExpirationEpoch() uint64 {
v2 := (storagegroup.StorageGroup)(sg)
// nolint:staticcheck
return v2.GetExpirationEpoch()
}

Expand All @@ -148,6 +149,7 @@ func (sg StorageGroup) ExpirationEpoch() uint64 {
//
// See also ExpirationEpoch.
func (sg *StorageGroup) SetExpirationEpoch(epoch uint64) {
// nolint:staticcheck
(*storagegroup.StorageGroup)(sg).SetExpirationEpoch(epoch)
}

Expand Down
4 changes: 3 additions & 1 deletion storagegroup/storagegroup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ func TestStorageGroup_ReadFromV2(t *testing.T) {
v2.SetMembers(generateOIDList())

size := v2.GetValidationDataSize()
// nolint:staticcheck
epoch := v2.GetExpirationEpoch()
mm := v2.GetMembers()
hashV2 := v2.GetValidationHash()
Expand Down Expand Up @@ -122,6 +123,7 @@ func TestStorageGroup_WriteToV2(t *testing.T) {
require.Nil(t, v2.GetValidationHash())
require.Nil(t, v2.GetMembers())
require.Zero(t, v2.GetValidationDataSize())
// nolint:staticcheck
require.Zero(t, v2.GetExpirationEpoch())
})

Expand All @@ -132,7 +134,7 @@ func TestStorageGroup_WriteToV2(t *testing.T) {
)

x.WriteToV2(&v2)

// nolint:staticcheck
require.Equal(t, x.ExpirationEpoch(), v2.GetExpirationEpoch())
require.Equal(t, x.ValidationDataSize(), v2.GetValidationDataSize())

Expand Down

0 comments on commit ad5f693

Please sign in to comment.