Skip to content

Commit

Permalink
fix: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
irrun committed Mar 7, 2024
1 parent d68a837 commit d06f545
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 15 deletions.
3 changes: 1 addition & 2 deletions gin/panic_recovery.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package middlewares
import (
"bytes"
"fmt"
"io/ioutil"
"log"
"net"
"net/http"
Expand Down Expand Up @@ -83,7 +82,7 @@ func stack(skip int) []byte {
// Print this much at least. If we can't find the source, it won't show.
fmt.Fprintf(buf, "%s:%d (0x%x)\n", file, line, pc)
if file != lastFile {
data, err := ioutil.ReadFile(file)
data, err := os.ReadFile(file)
if err != nil {
continue
}
Expand Down
5 changes: 2 additions & 3 deletions log/async_file_writer_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package log

import (
"io/ioutil"
"os"
"strings"
"testing"
Expand All @@ -12,12 +11,12 @@ func TestWriter(t *testing.T) {
w.Write([]byte("hello\n"))
w.Write([]byte("world\n"))
w.Stop()
files, _ := ioutil.ReadDir("./")
files, _ := os.ReadDir("./")
for _, f := range files {
fn := f.Name()
if strings.HasPrefix(fn, "hello") {
t.Log(fn)
content, _ := ioutil.ReadFile(fn)
content, _ := os.ReadFile(fn)
t.Log(string(content))
os.Remove(fn)
}
Expand Down
6 changes: 1 addition & 5 deletions log/internal/zap/json_encoder.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ func (enc *zapJsonEncoder) AppendByteString(val []byte) {
func (enc *zapJsonEncoder) AppendComplex128(val complex128) {
enc.addElementSeparator()
// Cast to a platform-independent, fixed-size type.
r, i := float64(real(val)), float64(imag(val))
r, i := real(val), imag(val)
enc.buf.AppendByte('"')
// Because we're always in a quoted string, we can use strconv without
// special-casing NaN and +/-Inf.
Expand Down Expand Up @@ -386,10 +386,6 @@ func (enc *zapJsonEncoder) EncodeEntry(ent zapcore.Entry, fields []zapcore.Field
return ret, nil
}

func (enc *zapJsonEncoder) truncate() {
enc.buf.Reset()
}

func (enc *zapJsonEncoder) closeOpenNamespaces() {
for i := 0; i < enc.openNamespaces; i++ {
enc.buf.AppendByte('}')
Expand Down
2 changes: 1 addition & 1 deletion log/internal/zap/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -309,8 +309,8 @@ func (zl *logger) sweetenFields(args []interface{}, skipCaller int) []zap.Field
usedFields[keyStr] += 1
if usedFields[keyStr] > 1 {
keyStr += strconv.Itoa(usedFields[keyStr])

}

fields = append(fields, zap.Any(keyStr, val))
}
i += 2
Expand Down
5 changes: 2 additions & 3 deletions log/logger_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package log_test

import (
"context"
"io/ioutil"
"os"
"strings"
"testing"
Expand All @@ -18,12 +17,12 @@ func initTestLogger(lvl types.Level) {
func printLogContent(t *testing.T) {
log.Stop()

files, _ := ioutil.ReadDir("./tmp")
files, _ := os.ReadDir("./tmp")
for _, f := range files {
fn := f.Name()
if strings.HasPrefix(fn, "test") {
t.Log(fn)
content, _ := ioutil.ReadFile("./tmp/" + fn)
content, _ := os.ReadFile("./tmp/" + fn)
t.Log(string(content))
}
}
Expand Down
1 change: 0 additions & 1 deletion node/validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ type validator struct {
client *ethclient.Client

scheduler *gocron.Scheduler
chainID *big.Int
mevRunning bool
}

Expand Down

0 comments on commit d06f545

Please sign in to comment.