Add bencode.Bytes.GoString
This commit is contained in:
parent
859d31facb
commit
02b6ee9954
@ -2,6 +2,7 @@ package bencode
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
|
"fmt"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Bytes []byte
|
type Bytes []byte
|
||||||
@ -23,3 +24,7 @@ func (me Bytes) MarshalBencode() ([]byte, error) {
|
|||||||
}
|
}
|
||||||
return me, nil
|
return me, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (me Bytes) GoString() string {
|
||||||
|
return fmt.Sprintf("bencode.Bytes(%q)", []byte(me))
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user