testify
testify copied to clipboard
Only check specific field value on struct slice? (contains)
I'm trying to check if a struct slice contains a struct which has a specific field value, but I don't want to check the whole struct/all the fields at once.
This is how I'm currently doing it:
(followers is a struct slice of a User struct which has ID among other fields)
I tried doing this but it didn't work:
Is there a better way to do this? I looked through the entire documentation but couldn't find a function that does this.
Thanks!