Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pkg/bigint/bigint.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func (i *BigInt) MarshalJSON() ([]byte, error) {
return []byte("null"), nil
}

return []byte(fmt.Sprintf(`"%s"`, i.String())), nil
return fmt.Appendf(nil, `"%s"`, i.String()), nil
}

func (i *BigInt) UnmarshalJSON(b []byte) error {
Expand Down
2 changes: 1 addition & 1 deletion pkg/crypto/eip712/typeddata.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func EncodeForSigning(typedData *TypedData) ([]byte, error) {
return nil, err
}

rawData := []byte(fmt.Sprintf("\x19\x01%s%s", string(domainSeparator), string(typedDataHash)))
rawData := fmt.Appendf(nil, "\x19\x01%s%s", string(domainSeparator), string(typedDataHash))
return rawData, nil
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/crypto/signer.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ type Signer interface {

// addEthereumPrefix adds the ethereum prefix to the data.
func addEthereumPrefix(data []byte) []byte {
return []byte(fmt.Sprintf("\x19Ethereum Signed Message:\n%d%s", len(data), data))
return fmt.Appendf(nil, "\x19Ethereum Signed Message:\n%d%s", len(data), data)
}

// hashWithEthereumPrefix returns the hash that should be signed for the given data.
Expand Down
2 changes: 1 addition & 1 deletion pkg/log/formatter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ type substr string
type point struct{ x, y int }

func (p point) MarshalText() ([]byte, error) {
return []byte(fmt.Sprintf("(%d, %d)", p.x, p.y)), nil
return fmt.Appendf(nil, "(%d, %d)", p.x, p.y), nil
}

// pointErr implements encoding.TextMarshaler but returns an error.
Expand Down
4 changes: 2 additions & 2 deletions pkg/storageincentives/proof_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,13 @@ func TestMakeInclusionProofsRegression(t *testing.T) {
// generate chunks that will be used as sample
sampleChunks := make([]swarm.Chunk, 0, sampleSize)
for i := 0; i < sampleSize; i++ {
ch, err := cac.New([]byte(fmt.Sprintf("Unstoppable data! Chunk #%d", i+1)))
ch, err := cac.New(fmt.Appendf(nil, "Unstoppable data! Chunk #%d", i+1))
if err != nil {
t.Fatal(err)
}

if i%2 == 0 {
id, err := crypto.LegacyKeccak256([]byte(fmt.Sprintf("ID #%d", i+1)))
id, err := crypto.LegacyKeccak256(fmt.Appendf(nil, "ID #%d", i+1))
if err != nil {
t.Fatal(err)
}
Expand Down
Loading