Add Golang skill and reference materials
- Introduced a new skill for Golang, providing comprehensive guidance on writing, debugging, and best practices for Go programming. - Added reference materials including effective Go guidelines, common patterns, and a quick reference cheat sheet to support users in Go development. - Created a skill creator guide to assist in developing new skills with structured templates and resource management. - Implemented scripts for skill initialization and packaging to streamline the skill creation process.
This commit is contained in:
@@ -566,9 +566,20 @@ func (l *Listener) HandleReq(msg []byte) (err error) {
|
||||
)
|
||||
var subbedFilters filter.S
|
||||
for _, f := range *env.Filters {
|
||||
// Check if this filter's limit was satisfied
|
||||
limitSatisfied := false
|
||||
if pointers.Present(f.Limit) {
|
||||
if len(events) >= int(*f.Limit) {
|
||||
limitSatisfied = true
|
||||
}
|
||||
}
|
||||
|
||||
if f.Ids.Len() < 1 {
|
||||
cancel = false
|
||||
subbedFilters = append(subbedFilters, f)
|
||||
// Filter has no IDs - keep subscription open unless limit was satisfied
|
||||
if !limitSatisfied {
|
||||
cancel = false
|
||||
subbedFilters = append(subbedFilters, f)
|
||||
}
|
||||
} else {
|
||||
// remove the IDs that we already sent, as it's one less
|
||||
// comparison we have to make.
|
||||
@@ -587,17 +598,16 @@ func (l *Listener) HandleReq(msg []byte) (err error) {
|
||||
if len(notFounds) == 0 {
|
||||
continue
|
||||
}
|
||||
// Check if limit was satisfied
|
||||
if limitSatisfied {
|
||||
continue
|
||||
}
|
||||
// rewrite the filter Ids to remove the ones we already sent
|
||||
f.Ids = tag.NewFromBytesSlice(notFounds...)
|
||||
// add the filter to the list of filters we're subscribing to
|
||||
cancel = false
|
||||
subbedFilters = append(subbedFilters, f)
|
||||
}
|
||||
// also, if we received the limit number of events, subscription ded
|
||||
if pointers.Present(f.Limit) {
|
||||
if len(events) >= int(*f.Limit) {
|
||||
cancel = true
|
||||
}
|
||||
}
|
||||
}
|
||||
receiver := make(event.C, 32)
|
||||
// if the subscription should be cancelled, do so
|
||||
|
||||
Reference in New Issue
Block a user