mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-27 15:16:43 +00:00
POS-2821: solve lint issues
This commit is contained in:
parent
d645a6dc27
commit
44b94ca6d3
8 changed files with 11 additions and 11 deletions
|
|
@ -1014,7 +1014,7 @@ func TestOOMMaliciousInput(t *testing.T) {
|
|||
|
||||
encb, err := hex.DecodeString(test.enc)
|
||||
if err != nil {
|
||||
t.Fatalf("invalid hex: %s" + test.enc)
|
||||
t.Fatalf("invalid hex: %s", test.enc)
|
||||
}
|
||||
|
||||
_, err = abi.Methods["method"].Outputs.UnpackValues(encb)
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ func BlockFromJSON(forkName string, data []byte) (*BeaconBlock, error) {
|
|||
case "capella":
|
||||
obj = new(capella.BeaconBlock)
|
||||
default:
|
||||
return nil, fmt.Errorf("unsupported fork: " + forkName)
|
||||
return nil, fmt.Errorf("unsupported fork: %s", forkName)
|
||||
}
|
||||
if err := json.Unmarshal(data, obj); err != nil {
|
||||
return nil, err
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ func ExecutionHeaderFromJSON(forkName string, data []byte) (*ExecutionHeader, er
|
|||
case "deneb":
|
||||
obj = new(deneb.ExecutionPayloadHeader)
|
||||
default:
|
||||
return nil, fmt.Errorf("unsupported fork: " + forkName)
|
||||
return nil, fmt.Errorf("unsupported fork: %s", forkName)
|
||||
}
|
||||
if err := json.Unmarshal(data, obj); err != nil {
|
||||
return nil, err
|
||||
|
|
|
|||
|
|
@ -547,7 +547,7 @@ func TestT9n(t *testing.T) {
|
|||
|
||||
switch {
|
||||
case err != nil:
|
||||
t.Logf(string(have))
|
||||
t.Log(string(have))
|
||||
t.Fatalf("test %d, json parsing failed: %v", i, err)
|
||||
case !ok:
|
||||
t.Fatalf("test %d: output wrong, have \n%v\nwant\n%v\n", i, string(have), string(want))
|
||||
|
|
@ -696,7 +696,7 @@ func TestB11r(t *testing.T) {
|
|||
|
||||
switch {
|
||||
case err != nil:
|
||||
t.Logf(string(have))
|
||||
t.Log(string(have))
|
||||
t.Fatalf("test %d, json parsing failed: %v", i, err)
|
||||
case !ok:
|
||||
t.Fatalf("test %d: output wrong, have \n%v\nwant\n%v\n", i, string(have), string(want))
|
||||
|
|
|
|||
|
|
@ -155,7 +155,7 @@ func dump(in *inStream, s *rlp.Stream, depth int, out io.Writer) error {
|
|||
defer s.ListEnd()
|
||||
|
||||
if size == 0 {
|
||||
fmt.Fprintf(out, ws(depth)+"[]")
|
||||
fmt.Fprint(out, ws(depth)+"[]")
|
||||
} else {
|
||||
fmt.Fprintln(out, ws(depth)+"[")
|
||||
|
||||
|
|
|
|||
|
|
@ -422,7 +422,7 @@ func TestBlockReceiptStorage(t *testing.T) {
|
|||
t.Fatalf("no receipts returned")
|
||||
} else {
|
||||
if err := checkReceiptsRLP(rs, receipts); err != nil {
|
||||
t.Fatalf(err.Error())
|
||||
t.Fatal(err.Error())
|
||||
}
|
||||
}
|
||||
// Delete the body and ensure that the receipts are no longer returned (metadata can't be recomputed)
|
||||
|
|
@ -432,7 +432,7 @@ func TestBlockReceiptStorage(t *testing.T) {
|
|||
}
|
||||
// Ensure that receipts without metadata can be returned without the block body too
|
||||
if err := checkReceiptsRLP(ReadRawReceipts(db, hash, 0), receipts); err != nil {
|
||||
t.Fatalf(err.Error())
|
||||
t.Fatal(err.Error())
|
||||
}
|
||||
// Sanity check that body alone without the receipt is a full purge
|
||||
WriteBody(db, hash, 0, body)
|
||||
|
|
|
|||
|
|
@ -478,7 +478,7 @@ func formatLogs(logs []StructLog) []StructLogRes {
|
|||
|
||||
formatted[index].Stack = &stack
|
||||
}
|
||||
if trace.ReturnData != nil && len(trace.ReturnData) > 0 {
|
||||
if len(trace.ReturnData) > 0 {
|
||||
formatted[index].ReturnData = hexutil.Bytes(trace.ReturnData).String()
|
||||
}
|
||||
if trace.Memory != nil {
|
||||
|
|
|
|||
|
|
@ -378,7 +378,7 @@ func (i *SliceStringFlag) UpdateValue(value string) {
|
|||
}
|
||||
|
||||
func (f *Flagset) SliceStringFlag(s *SliceStringFlag) {
|
||||
if s.Default == nil || len(s.Default) == 0 {
|
||||
if len(s.Default) == 0 {
|
||||
f.addFlag(&FlagVar{
|
||||
Name: s.Name,
|
||||
Usage: s.Usage,
|
||||
|
|
@ -482,7 +482,7 @@ func (m *MapStringFlag) UpdateValue(value string) {
|
|||
}
|
||||
|
||||
func (f *Flagset) MapStringFlag(m *MapStringFlag) {
|
||||
if m.Default == nil || len(m.Default) == 0 {
|
||||
if len(m.Default) == 0 {
|
||||
f.addFlag(&FlagVar{
|
||||
Name: m.Name,
|
||||
Usage: m.Usage,
|
||||
|
|
|
|||
Loading…
Reference in a new issue