Skip to main content
1 vote
1 answer
73 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 ...
lokesh's user avatar
  • 54
1 vote
0 answers
113 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....
Ahmad Sameh's user avatar
-3 votes
1 answer
115 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() { ...
Akshat Bhargava's user avatar
3 votes
0 answers
153 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) ...
Onyz's user avatar
  • 33
5 votes
1 answer
140 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" ...
Sunghoon Lim's user avatar
-2 votes
1 answer
91 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 ...
Musab Gulfam's user avatar
1 vote
1 answer
59 views

The following code produces an unexpected runtime error: package main import ( "fmt" "sync" ) func receiver(bChan <-chan int, wg *sync.WaitGroup) { for val := ...
Alon Kalif's user avatar
1 vote
1 answer
64 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 ...
Sayak Mukhopadhyay's user avatar
0 votes
1 answer
83 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....
unsafe_where_true's user avatar
1 vote
3 answers
330 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 ...
tim's user avatar
  • 21
1 vote
1 answer
96 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 ...
Jasvinder singh's user avatar
0 votes
1 answer
161 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 ...
mmind's user avatar
  • 11
0 votes
2 answers
79 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 ...
Be Chiller Too's user avatar
-3 votes
3 answers
182 views

I have a few convenience funcs and types in my utils package I use in several projects. They help me getting objects, array of objects from external apis via urls or custom requests (for auth api ...
vipaware's user avatar
0 votes
2 answers
151 views

I'm currently working on go app that has few main components: api http server, another component (metrics http server) and amqp component. Basically, api receives info like "new queue X was ...
Future Tribute's user avatar

15 30 50 per page
1
2 3 4 5
120