Skip to content

Commit

Permalink
apply suggestions
Browse files Browse the repository at this point in the history
Co-authored-by: Rootul P <[email protected]>
Co-authored-by: Oleg Kovalov <[email protected]>
  • Loading branch information
3 people authored Oct 14, 2024
1 parent 1359db0 commit fa5e214
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion share/namespace.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ func (n Namespace) MarshalJSON() ([]byte, error) {
return json.Marshal(n.data)
}

// MarshalJSON decodes json bytes to the namespace.
// UnmarshalJSON decodes json bytes to the namespace.
func (n *Namespace) UnmarshalJSON(data []byte) error {
var buf []byte
if err := json.Unmarshal(data, &buf); err != nil {
Expand Down
4 changes: 2 additions & 2 deletions share/random_shares.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"sort"
)

// RandShares generate 'total' amount of shares filled with random data.
// RandShares generates total amount of shares and fills them with random data.
func RandShares(total int) []Share {
if total&(total-1) != 0 {
panic(fmt.Errorf("total must be power of 2: %d", total))
Expand Down Expand Up @@ -35,7 +35,7 @@ func RandShares(total int) []Share {
return shares
}

// RandSharesWithNamespace is same the as RandShares, but sets same namespace for all shares.
// RandSharesWithNamespace is the same as RandShares, but sets the same namespace for all shares.
func RandSharesWithNamespace(namespace Namespace, namespacedAmount, total int) []Share {
if total&(total-1) != 0 {
panic(fmt.Errorf("total must be power of 2: %d", total))
Expand Down
2 changes: 1 addition & 1 deletion share/share_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ func TestShareToBytesAndFromBytes(t *testing.T) {
}

func TestMarshalShare(t *testing.T) {
sh := RandShares(1)
sh := RandShares(1)[0]
b, err := sh[0].MarshalJSON()

Check failure on line 244 in share/share_test.go

View workflow job for this annotation

GitHub Actions / lint / golangci-lint

invalid operation: cannot index sh (variable of type Share)

Check failure on line 244 in share/share_test.go

View workflow job for this annotation

GitHub Actions / lint / golangci-lint

invalid operation: cannot index sh (variable of type Share)

Check failure on line 244 in share/share_test.go

View workflow job for this annotation

GitHub Actions / test / test

invalid operation: cannot index sh (variable of type Share)
require.NoError(t, err)

Expand Down

0 comments on commit fa5e214

Please sign in to comment.