Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement stringsutil.ContainsAll #445

Closed
1 task done
Mzack9999 opened this issue Jun 20, 2024 · 0 comments · Fixed by #446
Closed
1 task done

Implement stringsutil.ContainsAll #445

Mzack9999 opened this issue Jun 20, 2024 · 0 comments · Fixed by #446
Assignees
Labels
Type: Maintenance Updating phrasing or wording to make things clearer or removing ambiguity.

Comments

@Mzack9999
Copy link
Member

Mzack9999 commented Jun 20, 2024

Before:

strings.Contains(s, "aa") && strings.Contains(s, "bb")

After

strings.ContainsAll(ss, "aa", "bb")

Potentially as a drop in replacement we can use stringsutil.Contains with variadic values:

func Contains(s []string, values ...string) bool { ... }

Example: https://github.com/projectdiscovery/nuclei/blob/cc03b7591a70822dd1aa7265f875c63ed3795af2/pkg/protocols/http/httpclientpool/options.go#L39

Tasks

  1. Status: Completed Type: Maintenance
    dogancanbakir
@Mzack9999 Mzack9999 added the Type: Maintenance Updating phrasing or wording to make things clearer or removing ambiguity. label Jun 20, 2024
@dogancanbakir dogancanbakir self-assigned this Jun 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Maintenance Updating phrasing or wording to make things clearer or removing ambiguity.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants