peer_protocol/protocol.go | 5 +++++ diff --git a/peer_protocol/protocol.go b/peer_protocol/protocol.go index ac958930c1815147e14c9fbc4066567e5e9f287a..da45d6772dc60f612e3a15b390aae7f4f6cb1aef 100644 --- a/peer_protocol/protocol.go +++ b/peer_protocol/protocol.go @@ -19,6 +19,11 @@ func (i *Integer) Read(r io.Reader) error { return binary.Read(r, binary.BigEndian, i) } +// It's perfectly fine to cast these to an int. +func (i Integer) Int() int { + return int(i) +} + const ( Protocol = "\x13BitTorrent protocol" )