
Security News
Opengrep Adds Apex Support and New Rule Controls in Latest Updates
The latest Opengrep releases add Apex scanning, precision rule tuning, and performance gains for open source static code analysis.
github.com/marstr/collection
Inspired by .NET's Linq, querying data structures used in this library is a snap! Build Go pipelines quickly and easily which will apply lambdas as they query your data structures.
Converting between slices and a queryable structure is as trivial as it should be.
original := []interface{}{"a", "b", "c"}
subject := collection.AsEnumerable(original...)
for entry := range subject.Enumerate(nil) {
fmt.Println(entry)
}
// Output:
// a
// b
// c
subject := collection.AsEnumerable(1, 2, 3, 4, 5, 6)
filtered := collection.Where(subject, func(num interface{}) bool{
return num.(int) > 3
})
for entry := range filtered.Enumerate(nil) {
fmt.Println(entry)
}
// Output:
// 4
// 5
// 6
subject := collection.AsEnumerable(1, 2, 3, 4, 5, 6)
updated := collection.Select(subject, func(num interface{}) interface{}{
return num.(int) + 10
})
for entry := range updated.Enumerate(nil) {
fmt.Println(entry)
}
// Output:
// 11
// 12
// 13
// 14
// 15
// 16
done := make(chan struct{})
subject := collection.NewQueue(1, 2, 3, 5, 8, 13, 21)
selected := subject.Enumerate(done).Skip(3).Take(3)
for entry := range selected {
fmt.Println(entry)
}
close(done)
// Output:
// 5
// 8
// 13
populated := collection.NewQueue(1, 2, 3, 5, 8, 13)
notPopulated := collection.NewQueue()
fmt.Println(populated.IsEmpty())
fmt.Println(notPopulated.IsEmpty())
// Output:
// false
// true
This library will conform to strict semantic versions as defined by semver.org's v2 specification.
I accept contributions! To ensure glide
users and go get
users retrieve the same commit, please submit PRs to the 'dev' branch. Remember to add tests!
FAQs
Unknown package
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The latest Opengrep releases add Apex scanning, precision rule tuning, and performance gains for open source static code analysis.
Security News
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Research
/Security News
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.