File tree Expand file tree Collapse file tree 1 file changed +23
-1
lines changed Expand file tree Collapse file tree 1 file changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -240,5 +240,27 @@ func (a Bytes) M__ge__(other Object) (Object, error) {
240
240
return NotImplemented , nil
241
241
}
242
242
243
+ func (a Bytes ) M__add__ (other Object ) (Object , error ) {
244
+ if b , ok := convertToBytes (other ); ok {
245
+ o := make ([]byte , len (a )+ len (b ))
246
+ copy (o [:len (a )], a )
247
+ copy (o [len (a ):], b )
248
+ return Bytes (o ), nil
249
+ }
250
+ return NotImplemented , nil
251
+ }
252
+
253
+ func (a * Bytes ) M__iadd__ (other Object ) (Object , error ) {
254
+ if b , ok := convertToBytes (other ); ok {
255
+ * a = append (* a , b ... )
256
+ return * a , nil
257
+ }
258
+ return NotImplemented , nil
259
+ }
260
+
243
261
// Check interface is satisfied
244
- var _ richComparison = (Bytes )(nil )
262
+ var (
263
+ _ richComparison = (Bytes )(nil )
264
+ _ I__add__ = (Bytes )(nil )
265
+ _ I__iadd__ = (* Bytes )(nil )
266
+ )
You can’t perform that action at this time.
0 commit comments