74,476 questions
-4
votes
0
answers
29
views
Unable to open Snapshot using VDDK
{"level":"error","ts":1764409482.772595,"caller":"vddk-service/service.go:125","msg":"Failed to open disk","error":"...
-4
votes
1
answer
71
views
Is the source code representation in the Go Programming Language the same as in Git?
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
44
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
77
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
96
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
77
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
56
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
132
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
97
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....
Best practices
0
votes
1
replies
55
views
How to constrain an interface to be only applicable for slices or maps
I've got a Matcher interface in Go that is implemented by quite a lot of underlying types.
I'd like to restrict the Matcher interface such that implementing types can only be a "collection", ...
0
votes
1
answer
55
views
Why does `.WithInitScripts` not run my SQL files? [closed]
Description
I am using a test Postgres container (from testcontainers) for more accurate integration tests. To prevent repeating code, I want to use my existing SQL migration files to setup the ...
0
votes
0
answers
40
views
Prorated upgrades on Razorpay
Use case: we have a subscription based system in our platform.
Plus tier monthly ( 199/- ) yearly ( 1199/- )
Pro tier monthly ( 499/- ) yearly ( 2999/- )
Subscriptions are being handled in Razorpay ...
0
votes
0
answers
63
views
gRPC YouTube disconnecting with EOF after a few seconds
I'm building a desktop application (Go + gRPC) to analyze YouTube Live Chat in real time.
The REST endpoint liveChatMessages.list works, but I want to switch to liveChatMessages.streamList because ...
Tooling
0
votes
1
replies
55
views
Matching compression libraries between GO and NPM
For context:
I have 2 projects of next.js and go respectively, previously I had a logic to compress some data in next.js backend (getServerSideProps) then send this data to next.js client side and ...
0
votes
0
answers
67
views
Can I send a JSON object to BigQuery without stringifying it?
I am trying to figure out if there is a way to send a JSON object to a BigQuery table that has a column of type JSON. I know the current practice is to stringify the JSON and send it over which gets ...
-4
votes
0
answers
85
views
How to config debugger in Goland
When I use "Step Into" in the debugger, it jumps into functions/types from outside my project (stdlib, vendor, etc.). How can I configure the debugger to step only into my own code?
That's ...
Advice
0
votes
0
replies
53
views
How to Delete an IP from a Cloudflare IP list in Go?
How do you delete a single item from an IP list in Cloudflare using Go?
Cloudflare has a feature where it stores lists of IPs, hostnames, or ASNs to be used in formulas. The web UI for this is in ...
1
vote
1
answer
62
views
SSH-bound Go CLI Daemon – SSH Connects Successfully, but No Input Accepted
I'm building a custom CLI daemon in Go for Ubuntu.
When I run the CLI locally (without SSH), everything works correctly — for example:
admin@admin> whoami
responds as expected.
However, after ...
1
vote
0
answers
93
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
0
votes
3
replies
98
views
How to safely move data within a slice in Go?
If I define a slice as follows then it will have a length of 0 and a capacity of 10:
var logs = make([]string, 0, 10)
After appending data to this slice, I check to see if it is at capacity and if it ...
-2
votes
0
answers
63
views
minio signature does not match golang api [closed]
I encountered a SignatureDoesNotMatch issue when switching MinIO from Docker Run to Docker Compose. I'm using PresignedUploadURLs to upload files from the frontend (React/Axios).
I've tried all the ...
Tooling
0
votes
2
replies
80
views
How to use a go package (SDK) locally in another project without pushing it to git for faster development
I am working on two Go projects at the same time, let's call the first one myApp and the second one my-sdk , both are seperate Golang projects. Both myApp and my-sdk are under development at the same ...
3
votes
1
answer
85
views
Failure to compile comparison expression of different typed variables [closed]
The title maybe vague because I don't know how to describe such situation.
// go 1.23.0
package main
import (
"fmt"
)
func compare(num uint16, bit uint8) bool {
// ok
return ...
Advice
0
votes
1
replies
58
views
If an expression in a return modifies an earlier result parameter, does the Go language spec guarantee the new value will be returned?
For example, does the Go language spec guarantee the following will print true?
https://go.dev/play/p/Rybua4uBb87
package main
import "fmt"
func main() {
fmt.Println(...
1
vote
1
answer
101
views
Why are Grep highlight sequences not read with `pty`?
I was experimenting with creack/pty while learning about pseudo terminals.
I spawned grep and hooked it up with a pseudo terminal device as follows:
package main
import (
"fmt"
&...
-2
votes
0
answers
27
views
Having trouble understanding folders and imports for versioned modules with version number >= 2 in golang [duplicate]
I'm having problems with versioning my modules
I have a project with module github.ext.myorg.com/aws-golang.
The new version of the my module is v4. However the running go mod tidy will always add the ...
0
votes
1
answer
76
views
Why can't Go, html/template, and Fiber collaborate to compose templates?
I want to render a template using a base template and one of two partial templates, based on the context. Something like:
Patial A Base Template
|──...
1
vote
0
answers
37
views
Beego ORM `rel(fk)` field causes panic in `getColumnTyp()` when running RunSyncdb
I am trying to define a foreign key field in a Beego ORM model, but the application crashes during RunSyncdb with the following panic:
panic: runtime error: invalid memory address or nil pointer ...
-2
votes
0
answers
65
views
Using golang's k8s.io appsv1 api to get the ReadyReplicas for a deployment does not agree with kubectl
In a retry/backoff loop, I check, using https://pkg.go.dev/k8s.io/api/apps/v1#Deployment:
ready := client.AppsV1().Deployments(f.Namespace).Get(context.TODO(), dep.GetName(), metav1.GetOptions{})....
0
votes
0
answers
63
views
Unable to upgrade knative/client from 0.42 to 0.47. invalid version: unknown revision 000000000000
I am using knative.dev/client v0.42.0 and I am trying to upgrade it to 0.47.0. I am using also:
knative.dev/networking v0.0.0-20251103014656-7d4a19889854
knative.dev/pkg v0.0.0-20251104154049-...
1
vote
1
answer
56
views
How to poll inside a synctest scope?
Golang 1.24 provides synctest, which can create isolated environments with synctest.Run(f) called bubbles that have their own synthetic clock. This is really useful for testing my production code, ...
1
vote
0
answers
24
views
Ginkgo Receive(BeEquivalentTo()) fails when comparing struct with interface payload
When writing Ginkgo unit tests, I ran into an issue asserting data received from a channel that contains a struct with an interface{} field.
Here's my models.go
type WsBaseMsg struct {
Type ...
1
vote
1
answer
52
views
How is GOPROXY cache queried for go modules with pseudo-versions?
I am looking at the contents of the GOPROXY cache. We publish a module https://github.com/google/oss-rebuild/. We don't have any tagged releases yet but we do have pseudo versions. For example, v0.0.0-...
Best practices
0
votes
2
replies
84
views
What is the best practices to delete outdated data from the SQLite database on the server?
I have a Golang server (pet project) and each second I add 2879 bytes of data in database. At the moment I'm about a 1GB of data. I want to cleanup the database to avoid a moment when I'm run out of ...
1
vote
1
answer
56
views
Go Gin/Gorilla WebSocket: Is conn.Close() enough to close client connection
So I’m kinda paranoid about stuff like this. I’m using the Gin framework and Gorilla WebSocket for the connection. My question is — is websocket.Conn.Close() enough to fully close the client ...
1
vote
1
answer
123
views
Go database/sql + godror: no error returned on Oracle ORA-56735 timeout from long-running query
Environment: Go 1.24.6, github.com/godror/godror v0.49.0, Oracle DB using database/sql DB.QueryContext (no explicit context timeout).
Problem:
I’m running a long-running query via database/sql with ...
1
vote
0
answers
44
views
Pion WebRTC: Video not received in Sub SFU when using ReplaceTrack in layered SFU architecture
Question:
I'm implementing a layered SFU architecture using Pion WebRTC in Go. The setup is as follows:
Architecture
Master SFU:
Receives a single upstream client stream (audio + video).
Only ...
0
votes
1
answer
53
views
gorazor: Can't find layout
For go i want to use the gorazor template engine.
I used code from gorazor repository and from go template benchmark and ran gorazor tpl tpl and got panic: Can't find layout: rzrexmpl/tpl/layout/base [...
0
votes
0
answers
80
views
Using an embedded interface [duplicate]
I'm trying to find the most efficient way to implement multiple screen-scraping bots. Each bot has a "name" and a "url", and each will have its own specialized scraping function ...
2
votes
0
answers
47
views
missing EventToken.h while building with webview and fyne-cross
So, after I added webview onto my app I try to compile my app, this error appears:
In file included from webview.cc:1: In file included from
/go/pkg/mod/github.com/webview/[email protected]...
Tooling
0
votes
4
replies
132
views
Cache Go dependencies in dev container
I'm trying to build a pre-built dev container (see here). Among others, the app has some Go dependencies specified in go.mod (link to file):
module github.com/jovandeginste/workout-tracker/v2
go 1.24....
1
vote
0
answers
100
views
Golang benchmarks involving goroutines show higher than expected allocations when controlling the timer manually
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....
2
votes
0
answers
47
views
How to use ITaskbarList3::SetProgressState and ITaskbarList3::SetProgressValue in Go? [duplicate]
I make a software in Go. Because it made a long process, it displays a progression bar. I show one with a *fyne.widget.ProgressBar, and I would like to add another one directly on the taskbar button ...
5
votes
1
answer
107
views
Use Petsc-Library in Go
I am trying to use the PETSc (Portable, Extensible Toolkit for Scientific Computation) library in Go over cgo. After the call of PetscInitialize, the program will crash at a random point with the ...
2
votes
1
answer
74
views
Purpose of WriteCommitted isolation transaction level (Golang database/sql package)
In Golang, database/sql package, there is a constant such as LevelWriteCommitted for the IsolationLevel type
https://pkg.go.dev/database/sql#IsolationLevel
What is the purpose of this level? There is ...
Best practices
2
votes
6
replies
133
views
Memory accounting and quotas for subtasks in golang programs
If I have a server written in golang that processes requests containing user queries, is there any viable method to track and limit the memory used by any given user request?
The server process does ...
1
vote
1
answer
87
views
How to display a progression bar on the task bar using Go and Fyne?
I am creating a little software in Golang. I use Fyne as GUI library. It creates long process (it it a file encrypter), so I display a progression bar, as it:
go func() {
go encryptCore(
...
-2
votes
1
answer
102
views
Goroutine not updating map correctly in concurrent Go program
I’m trying to update a map from multiple goroutines, but the results seem inconsistent. Sometimes keys are missing or values are wrong.
Here’s my code:
package main
import (
"fmt"
&...