99// MarshalText returns a text byte representation of Uint256.
100func (s Uint256) MarshalText() ([]byte, error) {
101 if s.Int == nil {
102 s.Int = big.NewInt(0) 103 }
104 if !math.IsValidUint256(s.Int) {
105 return nil, errors.Wrapf(errInvalidUint256, "value=%s", s.Int)
49// SSZBytes creates an ssz-style (little-endian byte slice) representation of the Uint256.
50func (s Uint256) SSZBytes() []byte {
51 if s.Int == nil {
52 s.Int = big.NewInt(0) 53 }
54 if !math.IsValidUint256(s.Int) {
55 return []byte{}
183}
184
185func (b batch) withRetryableError(err error) batch {
186 b.err = err187 return b.withState(batchErrRetryable)
188}
189
177}
178
179func (b batch) withPeer(p peer.ID) batch {
180 b.blockPid = p181 backfillBatchTimeWaiting.Observe(float64(time.Since(b.scheduled).Milliseconds()))
182 return b
183}
172 log.WithFields(b.logFields()).Debug("Backfill batch imported")
173 }
174 b.state = s
175 b.seq += 1176 return b
177}
178
A method that modifies its receiver value can have undesired behavior. The modification can also be the root of a bug because the actual value receiver could be a copy of that used at the calling site. This rule warns when a method modifies its receiver.
type data struct {
num int
key *string
items map[string]bool
}
func (d data) vmethod() {
d.num = 8
}
type data struct {
num int
key *string
items map[string]bool
}
func (d *data) vmethod() {
d.num = 8
}