Skip to main content
The 2026 Annual Developer Survey is live— take the Survey today!
Filter by
Sorted by
Tagged with
Filter by Employee ID
Score of 1
1 answer
149 views

I have a fan-out/fan-in worker pool that's supposed to stop all workers when the context is cancelled, but under heavy load with short timeouts, the goroutine count keeps climbing and never recovers. ...
Advice
0 votes
5 replies
170 views

I wrote an open port scanner in Go. For local adresses scans are instant. However, when I scan an external address it takes a bit longer, and I want to see the progress. I tried to implement a ...
Score of 1
1 answer
156 views

I have created a function to return the db connection of a postgresdb using pgxpool. But I don't want to create multiple pools since i will be calling this function each time to execute a query. Since ...
Score of 1
0 answers
137 views

Using go version go1.25.3 darwin/arm64. The below implementation is a simplified version of the actual implementation. type WaitObject struct{ c chan struct{} } func StartNewTestObject(d time....
Score of -3
1 answer
120 views

I created a single producer go routine which emits a value at random interval in an infinite for-loop, similar to this: func producer() <-chan uint64 { out := make(chan uint64) go func() { ...
Score of 3
0 answers
173 views

I’m trying to forward input from os.Stdin to a network stream in Go like this: go func() { for { if _, err := io.Copy(stream, os.Stdin); err != nil { log.Error(err) ...
Score of 5
1 answer
162 views

I quite new to go. I need some help. I guess I am facing a goroutine overhead. I was wondering if I can overcome the go-routine overhead. Here is my code. package main import ( "log" ...
Score of -2
1 answer
100 views

I’m building a Go backend to control IoT motors via MQTT. Each device activation is handled asynchronously by a goroutine. Here’s the simplified flow: A client POSTs /activate-device with device_id ...
Score of 1
1 answer
63 views

The following code produces an unexpected runtime error: package main import ( "fmt" "sync" ) func receiver(bChan <-chan int, wg *sync.WaitGroup) { for val := ...
Score of 1
1 answer
72 views

I am implementing a Zero MQ message listener service in Go, and I am struggling to find the most idiomatic pattern of processing those messages and storing them in a DB using Goroutines. I am ...
Score of 0
1 answer
119 views

For example, given this code, which I am reviewing right now, (pardon me the simplification a bit, but it should convey the gist): ctx, cancel := context.WithCancel(ctx) sigCh := make(chan os....
Score of 1
3 answers
421 views

I have a Go program that runs continuously, and I've noticed that both the number of goroutines and open file descriptors increase steadily over time (daily). However, the number of active network ...
Score of 1
1 answer
101 views

I was revising the concepts of the channels in go where I learned in the unbuffered channel if the receivers are less but senders are more then It must give deadlock and vice versa In my case first ...
Score of 0
1 answer
190 views

I'm trying to create some cron tasks to test out the https://github.com/go-co-op/gocron library. I'm exploring the singleton mode where if the same instance of a task is being executed, then it's ...
Score of 0
2 answers
86 views

Let's say I have a function F with the following logic: a <- input output <- a+10 b <- input output a+b stop Now I want to build two blocks (A and B) that implement this logic, each feeding ...

15 30 50 per page
1
2 3 4 5
120