74,403 questions
0
votes
0
answers
20
views
RabbitMQ block ports
unfortunately, after connecting RabbitMQ, I can't open my app on any port. After running, my app is up, but while RabbitMQ is running in Docker, I can't open Swagger on localhost with any port that I ...
-2
votes
0
answers
37
views
Why am I getting a deadlock? Golang Concurrency [closed]
I’m working on a web scraper using the Colly library in Go. My goal is to concurrently visit links found on a page and also check their HTTP status codes. To manage concurrency, I’m using sync....
1
vote
0
answers
24
views
Correct pattern to process ZeroMQ messages using Goroutines
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 ...
1
vote
1
answer
77
views
Go generics: analogs of C++ std::make_signed, std::make_unsigned
I'm trying to write Go generic function, which accepts a value of signed integer type and returns result having corresponding unsigned type.
C++11 provides special template for this case:
#include <...
1
vote
2
answers
59
views
How can I send UDP data over the loopback interface so that Wireshark can dissect it without ICMP errors?
Initial Problem
I had what I thought was a simple task in Golang: format some data according to one of Wireshark's dissectors (MAC-LTE) and then send it over UDP so that it could be viewed in ...
-1
votes
2
answers
62
views
Difference between map of interface and map of generic value constrained to that interface
Is there a difference between Environment and Environment_g in the following example?
package main
import "fmt"
type Variable[A any] interface {
Get() A
Set(A) error
}
type ...
0
votes
0
answers
39
views
Confluent librdkafka kafka.Consumer.ReadMessage timeout
I use the GoLang librdkafka client to consume messages from Kafka, code looks like:
msg, err := c.kafkaConsumer.ReadMessage(2 * time.Second)
2 second timeout is more a guess than a conscious decision....
0
votes
1
answer
60
views
Are these goroutines any leaks at all?
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....
-4
votes
0
answers
85
views
Is there a way to specify interface is implemented by pointer in go?
I'm running into an issue where I have to pick between bad options. Namely using value receiver, returning double pointer, or the inability to return nil on error. I feel like there's clearly "...
1
vote
0
answers
59
views
High Memory Usage in Golang GTFS Validator – Need Advice on Optimization [closed]
I’m working on a GTFS (General Transit Feed Specification) validator in Go that performs cross-file and cross-row validations. The core of the program loads large GTFS zip files (essentially big CSVs) ...
1
vote
2
answers
49
views
Building and deploying multiple Go lambdas via images in AWS with differing Go packages from one Dockerfile
I'm trying to build and deploy multiple Go based lambdas using 1 Dockerfile (as the instructions don't differ between lambdas) using different go packages for each lambda.
My file structure is as ...
2
votes
2
answers
83
views
How can an application running in a terminal find out the name of the terminal application in which it is running?
The application is written in Go. Is there a way for it to get the name of the terminal application in which it is running? Let's assume, in the case of Windows, to find out for sure that it is ...
-2
votes
1
answer
50
views
How to replace Go worker goroutines with Docker containers and then scale to Kubernetes pods? [closed]
I have a Go application that currently runs with the following structure:
A scheduler goroutine is responsible for managing task scheduling.
The scheduler spawns a fixed number of worker goroutines.
...
1
vote
0
answers
44
views
How do I use swaggo to generate openapi spec 3.1 for net/http default router?
I followed the instructions for swaggo v2 like so:
Ran the following from my project directory:
go install github.com/swaggo/swag/v2/cmd/swag@latest
$HOME/go/bin/swag init --v3.1
My project main file:...
-4
votes
0
answers
53
views
How to perform E2E testing with AWS S3 instead of local directory for file-based workflows? [closed]
I'm currently working on an go application that performs a sequence of file-based operations. Here's how it works:
The app takes a local directory path as input.
It reads or writes a number of files ...