Test driven development to check database queries involved methods

前端 未结 2 1850
长情又很酷
长情又很酷 2021-01-01 23:59

I want to create a database driven application using Golang. I am trying to do it TDD way. When I try to test methods that make Sql queries, What all are the packages availa

2条回答
  •  鱼传尺愫
    2021-01-02 00:26

    I use a global variable to store the data source (or connection string) of current database and set to different value in test function. Since there is only one database I need to operate so I choose the easiest way.

提交回复
热议问题