* 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 <[email protected]>
20 lines
373 B
Go
20 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]
|
|
}
|
|
}
|
|
}
|