mirror of
https://github.com/trufflesecurity/trufflehog.git
synced 2024-11-14 00:47:21 +00:00
1fb767247f
* Add missing pagination on github calls Includes some refactoring to improve readability and code reuse. * Close response body and handle rate limit * Re-include support for including users as repos to github scans * Fix gist test to match new func signature * Add current test name to logging * Support username as org use case * Also include no-auth user as org Co-authored-by: Bill Rich <bill.rich@trufflesec.com>
19 lines
373 B
Go
19 lines
373 B
Go
package common
|
|
|
|
func AddStringSliceItem(item string, slice *[]string) {
|
|
for _, i := range *slice {
|
|
if i == item {
|
|
return
|
|
}
|
|
}
|
|
*slice = append(*slice, item)
|
|
}
|
|
|
|
func RemoveStringSliceItem(item string, slice *[]string) {
|
|
for i, listItem := range *slice {
|
|
if item == listItem {
|
|
(*slice)[i] = (*slice)[len(*slice)-1]
|
|
*slice = (*slice)[:len(*slice)-1]
|
|
}
|
|
}
|
|
}
|