Skip to content

Commit

Permalink
fix(net:message) use iface in public function
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian Tiger Chow committed Sep 13, 2014
1 parent 4c95eb1 commit e2430ae
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions net/message/message.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,12 @@ func (m *message) Data() []byte {
}

// FromObject creates a message from a protobuf-marshallable message.
func FromObject(p *peer.Peer, data proto.Message) (*message, error) {
func FromObject(p *peer.Peer, data proto.Message) (NetMessage, error) {
bytes, err := proto.Marshal(data)
if err != nil {
return nil, err
}
return &message{
peer: p,
data: bytes,
}, nil
return New(p, bytes), nil
}

// Pipe objects represent a bi-directional message channel.
Expand Down

0 comments on commit e2430ae

Please sign in to comment.