Re: [go-nuts] Code has OOP smells but I can't think of a better refactor

2019-09-12 Thread Shinichi Kudo
Thank you! In the end I forgot that I had introduced the Helpers because I needed a higher level mocking point for something that mostly won't use Context - but then I found a powerful new tool, closures. Those solved the elegance problem completely. Andrew Chiw On 03.09.19 21:06, burak serda

Re: [go-nuts] Code has OOP smells but I can't think of a better refactor

2019-09-03 Thread burak serdar
On Tue, Sep 3, 2019 at 10:49 AM wrote: > > First - I have a Node struct, which represents a network connection to a node. > > > type Node struct { > *apiclient.Node > } > func (c *Node) GetStatus() (status *models.Status, err error) > func (c *Node) PostTransaction(signedEncodedTx, signedEncod

[go-nuts] Code has OOP smells but I can't think of a better refactor

2019-09-03 Thread randomshinichi4869
First - I have a Node struct, which represents a network connection to a node. type Node struct { *apiclient.Node } func (c *Node) GetStatus() (status *models.Status, err error) func (c *Node) PostTransaction(signedEncodedTx, signedEncodedTxHash string) (err error) func (c *Node) GetTopBloc