[go-nuts] Re: Mocking out calls in standard library

2023-03-31 Thread Jason E. Aten
I hasten to add, my library sshego makes it pretty easy to spin up and down an sshd. e.g. https://github.com/glycerine/sshego/blob/master/server_test.go On Friday, March 31, 2023 at 11:20:41 PM UTC-5 Jason E. Aten wrote: > I would just start a server on 127.0.0.1 and have it provide the expecte

[go-nuts] Re: Mocking out calls in standard library

2023-03-31 Thread Jason E. Aten
I would just start a server on 127.0.0.1 and have it provide the expected responses. This is simple and straightforward, and gives a much better test; end-to-end. The less mocking the better from my point of view. If you have to, you would simply wrap the existing structs, creating a higher l