net/http/httptest is a great package, either to use if your server is http-based or to emulate if you’re testing other protocols. I’ve also found io.Pipe to frequently be useful for this kind of testing.
I’d recommend reading through how net/http and x/net/http2 structures their tests. -eli > On Aug 7, 2023, at 8:27 AM, sumith s <sumith.kno...@gmail.com> wrote: > > Hi, > > Anyone have suggestion for writing test cases (best practices ) for client > server communication. > > -- > You received this message because you are subscribed to the Google Groups > "golang-nuts" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to golang-nuts+unsubscr...@googlegroups.com > <mailto:golang-nuts+unsubscr...@googlegroups.com>. > To view this discussion on the web visit > https://groups.google.com/d/msgid/golang-nuts/3fcc47e1-9610-4fa9-b2a8-bf7a408f546dn%40googlegroups.com > > <https://groups.google.com/d/msgid/golang-nuts/3fcc47e1-9610-4fa9-b2a8-bf7a408f546dn%40googlegroups.com?utm_medium=email&utm_source=footer>. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/8AABDA94-74A2-4D5D-B555-E2EBFA3A2ACF%40siliconsprawl.com.