go-sqlmock icon indicating copy to clipboard operation
go-sqlmock copied to clipboard

feature: create rows columns and value from structs and slice by custom tag

Open Rennbon opened this issue 2 years ago • 13 comments

It's easier to develop

Rennbon avatar Dec 07 '21 06:12 Rennbon

Hello @Rennbon. That is a great addition. I noticed that you add a new dependency for testing here. Do you think you can rewrite the test cases using the vanilla testing package only as I'm not sure if there is a need to change that at the moment? @l3pp4rd do you agree?

theodesp avatar Dec 07 '21 11:12 theodesp

您好,我已经收到您的邮件,我会尽快给您回复,祝您好运。

danpi avatar Dec 07 '21 11:12 danpi

I wonder why you ask me :)

Personally, I do use testify; but if this project does not use it yet and has the policy to avoid external testing libraries, I agree that introducing it there is not a good idea.

AlekSi avatar Dec 07 '21 11:12 AlekSi

I wonder why you ask me :)

Personally, I do use testify; but if this project does not use it yet and has the policy to avoid external testing libraries, I agree that introducing it there is not a good idea.

Hey @AlekSi Sorry I tagged you wrongly. Glad to get some feedback though.

theodesp avatar Dec 07 '21 11:12 theodesp

That is a great addition. I noticed that you add a new dependency for testing here. Do you think you can rewrite the test cases using the vanilla testing package only as I'm not sure if there is a need to change that at the moment? @l3pp4rd do you agree?

OK

Rennbon avatar Dec 07 '21 12:12 Rennbon

@theodesp I removed testify and used reflect.DeepEqual to verify that it was as expected.

Rennbon avatar Dec 07 '21 13:12 Rennbon

@Rennbon Thank you. Will try to test it this week a bit more.

theodesp avatar Dec 20 '21 11:12 theodesp

@Rennbon Thank you. Will try to test it this week a bit more.

Ok, hope to merge soon.

Rennbon avatar Dec 20 '21 12:12 Rennbon

@theodesp Is there anything wrong with this PR

Rennbon avatar Feb 15 '22 08:02 Rennbon

@l3pp4rd Is there a way to add this PR in Travis CI/CD pipeline please. It seems that I'm not able to see the test results in order to merge. Thank you.

theodesp avatar Feb 21 '22 10:02 theodesp

Those are utility functions. They don't have to be in the sqlmock core. They could be published as a separate package.

dolmen avatar Apr 22 '22 22:04 dolmen

Those are utility functions. They don't have to be in the sqlmock core. They could be published as a separate package.

From a usage perspective, this commit reduces mock writing complexity. If go-sqlmock implements this functionality directly, it will be easier for developers to use.

Rennbon avatar Apr 23 '22 13:04 Rennbon

@dolmen 这个库是Go 1.15的,不是所有引用库都会升级到1.18的

Rennbon avatar May 07 '22 04:05 Rennbon