Skip to content

Port Contains method#4

Merged
bwplotka merged 2 commits intoefficientgo:mainfrom
saswatamcode:contains
Dec 1, 2022
Merged

Port Contains method#4
bwplotka merged 2 commits intoefficientgo:mainfrom
saswatamcode:contains

Conversation

@saswatamcode
Copy link
Copy Markdown
Collaborator

This ports the Contains method from Thanos testutil package.

Signed-off-by: Saswata Mukherjee <saswataminsta@yahoo.com>
Copy link
Copy Markdown
Contributor

@bwplotka bwplotka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Some comment, WDYT?

Comment thread testutil/testutil.go Outdated

// Contains fails the test if needle is not contained within haystack, if haystack or needle is
// an empty slice, or if needle is longer than haystack.
func Contains(tb testing.TB, haystack, needle []string) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be.... generic? ;p

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Otherwise, let's use ContainsStringSlice function name?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right! Something generic would suit here. Let me try to tackle that in next PR. Changing name for now! 🙂

Signed-off-by: Saswata Mukherjee <saswataminsta@yahoo.com>
Copy link
Copy Markdown
Contributor

@bwplotka bwplotka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@bwplotka bwplotka merged commit ba593f6 into efficientgo:main Dec 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants