32 questions from the last 30 days
5
votes
1
answer
90
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
83
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"
&...
2
votes
1
answer
100
views
json string to uint64 convert workaround
I'm currently trying to use json.Unmarshal to convert a json response from server into a type struct.
Part of my type struct uses a type from a library (https://pkg.go.dev/github.com/clarkzjw/starlink-...
-4
votes
1
answer
106
views
golang http.Get() only returning a portion of html body
CONTEXT: My goal is to use http.Get(), then use the golang.org/x/net/html package to parse the resp.Body and extract some bits of data from some <div>'s that all use a similar naming scheme for ...
-4
votes
1
answer
105
views
A global sync.Mutex don't work with multiple client packages?
I have a package "tools" that expose a method that must execute some logic only one time. The next calls don't do nothing.
The file tools/tools.go is like:
package tools
import (
"...
0
votes
1
answer
103
views
How can I have a tools-only folder/module?
My project has the following folder structure:
.
├── mkdotenv
│ ├── core
│ │ ├── dotenv_resolve.go
│ │ └── dotenv_resolve_test.go
│ ├── files
│ │ └── files.go
│ ├── go.mod
│ ├── go....
-1
votes
2
answers
71
views
How to use gorazor and iterate over a slice
I want to use gorazor a viewengine written in go that uses razor-Syntax. They provide an example which i tried to understand and adapt.
What is working
I want to iterate over a slices of movies and ...
3
votes
0
answers
112
views
Bind form data into nested slice with Gin-Gonic
I'm trying to send a post request with form data and bind it to a nested slice.
Here's a minimal example:
type House struct {
Rooms []Room `form:"rooms"`
}
type Room struct {
...
0
votes
0
answers
77
views
Druid Timestamp formatting issue — data correct, but still shows UTC (Z)
I have a Druid SQL query that returns data correctly for different timezones (UTC, EST), but the timestamp format is still shown in UTC (Z), even though the values are correct.
timestamp ...
2
votes
2
answers
102
views
Trying to build golang package ending up with GCC compilation segfault on as --gdwarf-5
After some package upgrade on my Ubuntu 24.04 I stumbled upon inability to build/install/work with almost any of golang packages.
So, I'm trying to install staticcheck and get the following error:
$ ...
1
vote
1
answer
206
views
How to cache downloaded go dependencies in a containerized custom script execution?
One of my build steps is a custom script:
bash test/test.sh
The script itself sits in the source code and launches the testing:
cd test && go test github.com/geniot/blaze-test/src -json
I ...
Best practices
0
votes
2
replies
98
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
44
views
What is the better way to use fyne dialogs synchronously in Go?
I am programming a little software in Go called GoFileEncoder. For the file dialog boxes, I would like to use fyne.io/fyne/v2/dialog. Only, the functions dialog.ShowFileOpen() and dialog.ShowFileSave()...
3
votes
2
answers
90
views
MongoDB Go driver’s topology view is stale and reports no primary indefinitely
I'm encountering an issue in a Go application that uses the official MongoDB Go driver. We have the use case where a ReplicaSet is recreated from scratch. Replica Set consists of 2 members, no arbiter ...
1
vote
1
answer
59
views
How to set min window size for application
I just want to create a simple chat app. I try setting the min size for myWindow but only found SetMinSize function on baseObject, not for container or layout. Right now my app can shrink very small ...