Can I create shared test utilities?

前端 未结 1 1669
醉酒成梦
醉酒成梦 2020-11-30 12:29

I\'m wondering whether it\'s possible to share test utility code across packages in go. Specifically, I\'m writing a TCP server that will be used by multiple handlers for d

相关标签:
1条回答
  • 2020-11-30 12:53

    Create a package containing the testing utilities in non _test.go files. A couple of examples of this approach are httptest and iotest.

    0 讨论(0)
提交回复
热议问题