context.Context should be the first parameter of a function
1120 return b
1121}
1122
1123func SaveBlock(tb assertions.AssertionTestingTB, ctx context.Context, db iface.NoHeadAccessDatabase, b interface{}) interfaces.SignedBeaconBlock {1124 wsb, err := blocks.NewSignedBeaconBlock(b)
1125 require.NoError(tb, err)
1126 require.NoError(tb, db.SaveBlock(ctx, wsb))
Description
context.Context
should be the first parameter of a function.
Bad practice
func badPatternFunc(k favContextKey, ctx context.Context) {
// do something
}
Recommended
func goodPatternFunc(ctx context.Context, k favContextKey) {
// do something
}