74,494 questions
1
vote
1
answer
72
views
Accessing postgres db using pgxpool in a goroutine
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 ...
1
vote
0
answers
45
views
Why is go build trying to download local code, but only in gitlab
We have a project with 3 git repositories, let's call them backend, ui and library, hosted at gitlab.com/mycompany. These build quite happily.
I am trying to move the three repos into one, so we now ...
1
vote
1
answer
33
views
Go terraform unrecognized import path from GCP Artifact Registry
I get an error when trying to download private go dependencies from artifact registry via terraform:
│ Error: Error waiting to create function: Error waiting for Creating function: Error code 3, ...
29
votes
6
answers
47k
views
List of currently running process in Go
How can I get the list of currently running processes in Go?
The OS package provides some functions: http://golang.org/pkg/os/
but doesn't give anything to see the list of running processes.
2
votes
0
answers
118
views
Is it possible to retrieve lists of HDF5 file, group, dataset, and attribute in Golang
I'm currently working on developing data reading and writing for HDF5 files in Golang. I've consulted the library documentation and managed to successfully implement writing operations. Now, I need to ...
11
votes
3
answers
9k
views
Creating Kafka topic in sarama
Is it possible to create kafka topic in sarama?
I know java API enables you do create topic but I couldn't find any information on how to do that in sarama.
if it's possible, an example or explanation ...
Best practices
0
votes
5
replies
97
views
Best practices for architecting a Go CLI with ~100 commands and many flags, how to organize commands/flags?
I'm designing a CLI tool in Go that will expose roughly 100 commands. Each command has its own set of flags, and there are also several global flags. My main goals are maintainability, testability, ...
18
votes
2
answers
2k
views
Invalid settings: setting option "vulncheck": invalid option "Prompt" for enum
the default option of go.diagnostic.vulncheck
it's warning "Invalid settings: setting option "vulncheck": invalid option "Prompt" for enum".
haven't find any other ...
0
votes
0
answers
120
views
DB query execution hanging in golang
I don’t understand why this is happening. I’m using the Go database package to connect to a PostgreSQL database. I loop through fullmsg (88 messages), but after processing about 27 messages, ...
Best practices
1
vote
0
replies
29
views
Where should I create the application session when using an internal SSO (Gin + OAuth2)?
I’m integrating an internal SSO (OAuth2) into a web application using Gin (Go), and I’m a bit unsure about the right place to create the application session.
The SSO is the only authentication ...
Tooling
2
votes
3
replies
81
views
Go server and godot P2P connection with out port forwarding
This days me and my friend made a multiplayer game in godot. The server is written in go using protobaf. To test the multiplayer, i used ngrok. I know we can use port forwarding but i thought ngrok is ...
0
votes
1
answer
47
views
Azure DevOps REST API (Go): How to retrieve all users with permissions on a project? [duplicate]
I’m trying to retrieve all users who have permissions on a specific Azure DevOps project (i.e., the users shown in the project’s Permissions tab).
I understand how to retrieve a list of projects using ...
-2
votes
0
answers
74
views
How can http.Server be made to hold open a connection? [closed]
I'd like to add a unit test for Go's http.Server.Shutdown() timing out, but there are no connections held open when the shutdown signal is sent, so it never gets to checking for timeouts, even though ...
0
votes
0
answers
57
views
How do I use the Terratest shell module? [closed]
I’ve been trying to use the Terratest shell module to execute bash commands, but I haven’t had much success. Documentation appears to be limited, and most references I found were via AI tools. Below ...
0
votes
0
answers
60
views
Go code using WMI returns inconsistent USB port count; how to reliably get fixed physical USB ports?
I'm trying to get the number of physical USB ports on a Windows machine using Go and WMI. I wrote the following code using ole and oleutil:
func GetUSBCount() (int, error) {
runtime.LockOSThread()
...