Golang sqlmock db tests — SELECT тесты
func TestFindAll(t *testing.T) { dbMock, mock, err := sqlmock.New() if err != nil { t.Errorf(«An error ‘%s’ was not expected when opening a stub database connection», err) } defer dbMock.Close() columns := []string{«id», «date», «name», «code»} expectedData := Data{ Id:…
Read more