Goqueue
See https://github.com/damnever/goctl
Install / Use
/learn @damnever/GoqueueREADME
A GoRoutine safe queue for Golang

It is similar to the Queue of Python.
Installation
go get github.com/damnever/goqueue
Example
Just for example, I use Queue.Get(0) and Queue.PutNoWait(value) more and often, but channel is not a right way do that...
package main
import (
"fmt"
"sync"
"github.com/Damnever/goqueue"
)
func main() {
queue := goqueue.New(0)
wg := &sync.WaitGroup{}
worker := func(queue *goqueue.Queue) {
defer wg.Done()
for !queue.IsEmpty() {
val, err := queue.Get(0)
if err != nil {
fmt.Println("Unexpect Error: %v\n", err)
}
num := val.(int)
fmt.Printf("-> %v\n", num)
if num%3 == 0 {
for i := num + 1; i < num+3; i++ {
queue.PutNoWait(i)
}
}
}
}
go func() {
defer wg.Done()
for i := 0; i <= 27; i += 3 {
queue.PutNoWait(i)
}
}()
for i := 0; i < 5; i++ {
go worker(queue)
}
wg.Add(6)
wg.Wait()
fmt.Println("All task done!!!")
}
Related Skills
node-connect
347.2kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
xurl
347.2kA CLI tool for making authenticated requests to the X (Twitter) API. Use this skill when you need to post tweets, reply, quote, search, read posts, manage followers, send DMs, upload media, or interact with any X API v2 endpoint.
frontend-design
108.0kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
347.2kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
