Skip to content

Commit

Permalink
Fix perfsprint linter round 2
Browse files Browse the repository at this point in the history
  • Loading branch information
KaloyanTanev committed Jul 19, 2024
1 parent b08ed40 commit d649ce5
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion app/eth2wrap/synthproposer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ func TestSynthProposerBlockNotFound(t *testing.T) {

return nil, &eth2api.Error{
Method: http.MethodGet,
Endpoint: fmt.Sprintf("/eth/v2/beacon/blocks/%s", blockID),
Endpoint: "/eth/v2/beacon/blocks/" + blockID,
StatusCode: http.StatusNotFound,
Data: []byte(fmt.Sprintf(`{"code":404,"message":"NOT_FOUND: beacon block at slot %s","stacktraces":[]}`, blockID)),
}
Expand Down
2 changes: 1 addition & 1 deletion app/log/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ func InitLogger(config Config) error {
}

if config.LogOutputPath != "" {
fileWriter, _, err := zap.Open(fmt.Sprintf("lumberjack:%s", config.LogOutputPath))
fileWriter, _, err := zap.Open("lumberjack:" + config.LogOutputPath)
if err != nil {
return errors.Wrap(err, "open file writer")
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/createcluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ func runCreateCluster(ctx context.Context, w io.Writer, conf clusterConfig) erro
}

if dashboardURL != "" {
log.Info(ctx, fmt.Sprintf("You can find your newly-created cluster dashboard here: %s", dashboardURL))
log.Info(ctx, "You can find your newly-created cluster dashboard here: "+dashboardURL)
}

return nil
Expand Down
4 changes: 2 additions & 2 deletions core/priority/calculate_internal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
package priority

import (
"fmt"
"math/rand"
"strconv"
"testing"

"github.com/stretchr/testify/require"
Expand Down Expand Up @@ -167,7 +167,7 @@ func TestCalculateResults(t *testing.T) {
Topic: toAny("ignored"),
},
},
PeerId: fmt.Sprint(j),
PeerId: strconv.Itoa(j),
Duty: &pbv1.Duty{Slot: test.Slot},
})
}
Expand Down
2 changes: 1 addition & 1 deletion core/validatorapi/router_internal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1899,7 +1899,7 @@ func (h testHandler) newBeaconHandler(t *testing.T) http.Handler {
})
mux.HandleFunc("/eth/v1/config/spec", func(w http.ResponseWriter, r *http.Request) {
res := map[string]any{
"SLOTS_PER_EPOCH": fmt.Sprint(slotsPerEpoch),
"SLOTS_PER_EPOCH": strconv.Itoa(slotsPerEpoch),
}
writeResponse(ctx, w, "", nest(res, "data"), nil)
})
Expand Down
2 changes: 1 addition & 1 deletion dkg/dkg.go
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ func Run(ctx context.Context, conf Config) (err error) {
log.Info(ctx, "Successfully completed DKG ceremony 🎉")

if dashboardURL != "" {
log.Info(ctx, fmt.Sprintf("You can find your newly-created cluster dashboard here: %s", dashboardURL))
log.Info(ctx, "You can find your newly-created cluster dashboard here: "+dashboardURL)
}

return nil
Expand Down
3 changes: 1 addition & 2 deletions eth2util/rlp/rlp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ package rlp_test

import (
"crypto/rand"
"fmt"
"strconv"
"testing"

Expand Down Expand Up @@ -184,7 +183,7 @@ func TestBytes(t *testing.T) {

func TestLengths(t *testing.T) {
for _, length := range []int{0, 1, 55, 56, 1023, 1024} {
t.Run(fmt.Sprint(length), func(t *testing.T) {
t.Run(strconv.Itoa(length), func(t *testing.T) {
buf := make([]byte, length)
_, err := rand.Read(buf)
require.NoError(t, err)
Expand Down
3 changes: 2 additions & 1 deletion testutil/beaconmock/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"math/big"
"net/http"
"sort"
"strconv"
"strings"
"time"

Expand Down Expand Up @@ -244,7 +245,7 @@ func WithGenesisTime(t0 time.Time) Option {
mock.overrides = append(mock.overrides, staticOverride{
Endpoint: "/eth/v1/beacon/genesis",
Key: "genesis_time",
Value: fmt.Sprint(t0.Unix()),
Value: strconv.FormatInt(t0.Unix(), 10),
})
}
}
Expand Down

0 comments on commit d649ce5

Please sign in to comment.