74,480 questions
1
vote
1
answer
39
views
Why structs constructed from XML have empty fields?
I am trying to write an XML parser which will load a data from XML file and convert it to golang structs, but apparently it is not working and I have no idea why. I wrote a test to troubleshoot it, ...
2
votes
1
answer
34
views
Parsing MySQL Client Handshake response message
I'm trying to parse the Handshake response packet from MySQL client/server protocol
For the task I'm connecting to the application via mysql cli client:
mysql --version
mysql Ver 9.5.0 for macos15.4 ...
1
vote
0
answers
23
views
Best practice to access an union fields in Golang from a dll
I have a dll that exposes a method that executes a callback passing a pointer to a struct that we can think like this:
struct Msg {
uint32_t type;
uint32_t length;
union data{
...
-3
votes
0
answers
48
views
Why does my Go HTTP server freeze when I call another API inside a goroutine? [closed]
Why does my Go HTTP server freeze when I call another API inside a goroutine?
func handler(w http.ResponseWriter, r *http.Request) {
go func() {
resp, err := http.Get("https://example....
-9
votes
0
answers
56
views
Unable to open Snapshot using VDDK [closed]
{"level":"error","ts":1764409482.772595,"caller":"vddk-service/service.go:125","msg":"Failed to open disk","error":"...
-7
votes
1
answer
107
views
Is the source code representation in the Go Programming Language the same as in Git? [closed]
git(1) uses one representation when storing source code (not binary) by default which IIRC is utf-8 (no working-tree-encoding). Is this the same default as in Go?
I tried comparing to Git but have ...
0
votes
0
answers
50
views
Why am I observing an unexpected behavior using github.com/utrack/gin-csrf
I'm using the github.com/utrack/gin-csrf package to implement CSRF protection in my web application and using. I'm observing an unexpected pattern using the simple go application in their repo.
Step 1 ...
1
vote
1
answer
83
views
MongoDB Go Driver v2: How to Marshal a Nil Custom Type as BSON Null?
I’m using MongoDB GoLang Driver v2 and I want to store a custom money type in MongoDB.
If the value is nil, I want the BSON document to store price: null.
Example document I want:
{
"name":...
1
vote
0
answers
103
views
Is it possible to set stdin of a process to a pipe and the rest to a TTY device?
I am trying to spawn a process so that I can do the following:
Send text to its standard input and specify EOF by closing the stdin pipe.
Connect the process' stdout and stderr to a TTY device so ...
1
vote
0
answers
83
views
Heavy duplication when upserting with GORM generics in SQLite
I have several models in my application, which have associations between each other. I'm trying to recursively upsert them, but haven't been able to find a good solution that doesn't extensively rely ...
0
votes
0
answers
59
views
Deploying a Digital Ocean Go serverless function with outside libraries
I am unable to build/deploy a digital ocean function that relies on nonstandard libraries (some third party, others local). I have three projects: an API, the DO functions, and a common library used ...
-5
votes
1
answer
83
views
Why do ' i/o timeout' occur when I use codeberg.org/miekg/dns?
I had problems using codeberg.org/miekg/dns. When the server starts and the client requests a DNS message, the client will output an i/o timeout. I have been investigating for a long time, but still ...
-5
votes
0
answers
67
views
Go -race tests fail on GitHub Actions Ubuntu with ThreadSanitizer ENOMEM (works on macOS) [closed]
Post body (StackOverflow / Reddit / etc.)
I’m running Go tests with the race detector in GitHub Actions via Nix, and I always hit a ThreadSanitizer allocation error on Linux runners. On macOS runners ...
1
vote
1
answer
151
views
"undefined: rt" when trying to add quit option to menu [closed]
I'm trying to follow the Wails manual and wanted to learn about Menus (V2.11).
The snippet from the example leads to an error:
undefined: rt
What do I have to change to make this snippet run?
There ...
-1
votes
1
answer
101
views
Why is my outbound connection being refused?
I deployed the following app as a Google Cloud Run service:
package main
import (
"io"
"net/http"
)
func main() {
http.HandleFunc("/", func(w http....