Skip to main content

Question list filters

Filter by
Sorted by
Tagged with
Score of 0
0 answers
128 views

I have a project using go.work, I upgraded to go 1.27 recently, and seems when start go application, it might change go.work.sum automatically sometimes, this has happened a few times in last 10 days. ...
Score of 1
0 answers
72 views

I am using the Fuego in GIN for my project. I have defined DTO structs with validation tags. Here is my struct: type GetAllUserQuery struct { Limit int `query:"limit" validate:"...
Score of 2
1 answer
173 views

I'm implementing a JSON parser. According to JSON rules, a number can be an integer, a negative number, a decimal, or use exponent notation, like 42, -42, 3.14, 0.5, 1e10, 2.5e-3 I currently have a ...
Score of 2
0 answers
115 views

I am maintaining an internal Go library, which has a pubsub package. Currently, it doesn't support message ordering, but I would like to enable it. I want to make it as simple as possible by using ...
Score of 2
1 answer
127 views

I'm looking at golang library https://gioui.org/ When I run a hello world example: package main import ( "image/color" "log" "os" "gioui.org/app&...
Score of 0
0 answers
98 views

I created a simple method for the app data struct in Go: func (a *app) route(s *store.Storage) *chi.Mux { tokenAuth := jwtauth.New("HS256", []byte(s.JWTSecret), nil) mux := chi....
Score of 1
1 answer
139 views

I need to generate a set of evenly spaced numeric values covering a given range. This is mainly intended for things such as chart axes, scales, thresholds, and similar UI representations. Simply ...
Score of 2
1 answer
115 views

When using the new encoding/json/v2 package, and unmarshaling some JSON, it will potentially return a json.SemanticError error. As far as I can see, json.SemanticError is returned when the JSON is ...
Score of -1
0 answers
144 views

This error puzzles me, and I believe a more in-depth analysis could help clarify the issue: I cannot say for certain whether the behavior described below is legitimate or an actual error in ...
Score of 1
2 answers
135 views

I am working on a web app with the following architecture: The frontend is a React app written in TypeScript. The "backend" is written in Go, and compiled to WASM for distribution with the ...
Score of -1
1 answer
481 views

In a Go program I got this error message: fatal error: concurrent map writes The message is shown in the terminal window of VS Code. But in my log there is nothing, which make sense because log....
Score of 2
2 answers
360 views

Unlike Go's iota-based enums, Java enums are singleton objects. Each enum constant is a unique instance that can carry additional state and behavior, while also providing name(), ordinal(), values(), ...
Score of 1
1 answer
248 views

I am working on a web crawler using Go and Supabase. This section of code throws an error when the length of the newLinks slice is above a certain number -- I haven't been able to determine what that ...
Score of 4
0 answers
283 views

In the past I've used the version of WalkDir that is not based on fs.FS, but I recently tried changing to the fs.FS-based one so that I could more cleanly do unit testing. But now I feel like I'm not ...
Score of 0
4 answers
363 views

In Python, I can use the str.isdigit() method to check whether a string contains only numeric characters. For example: "12345".isdigit() # True "123a".isdigit() # False &...
Score of 1
0 answers
124 views

package browser import ( "context" "log" "os" "os/exec" "time" "sync" "path/filepath" "...
Score of 2
1 answer
173 views

I am trying to fix the compilation of file overlay/tun_freebsd.go in module github.com/slackhq/nebula on armv7 FreeBSD. This file uses the syscall.Iovec structure, which is defined as type Iovec ...
Score of 1
1 answer
195 views

I have a fan-out/fan-in worker pool that's supposed to stop all workers when the context is cancelled, but under heavy load with short timeouts, the goroutine count keeps climbing and never recovers. ...
Score of 0
1 answer
232 views

I am trying to grasp (and sofar failing) to exactly grasp how the following code example works. It wraps (decorates) a standard http.client with 2 middleware functions (Logger and BasicAuth) that are ...
Score of 0
0 answers
132 views

When using fsnotify directly in Go, saving a single file triggers 4 to 5 raw events per save. For example saving a file in VSCode produces WRITE, CHMOD, WRITE, RENAME and CREATE events all from one ...
Score of 1
1 answer
205 views

I'm running into a strange error when running the .exe that I built from a simple Go script I'm making, when I try to run the .exe it gives the following error and deletes the .exe file: Translation: ...
Score of -1
1 answer
107 views

I'm developing a hacking system that involves compiling hacking scripts to be injected in a CTF server. My goal is to compile each script from executing go build from Go code because the CTF server ...
Score of 2
1 answer
103 views

I use github.com/diamondburned/gotk4/pkg/gtk/v4. I'd like to create a modal dialog, like this: dialog := gtk.NewMessageDialog( &window.Window, gtk.DialogModal|gtk.DialogDestroyWithParent, ...
Score of -3
1 answer
151 views

I'm writing a function that gets student grades in parallel goroutines and returns their arithmetic mean at the end. If at least one student has an error, the function should return the first error ...
Score of 0
3 answers
196 views

I am reading up about wrapping and unwrapping errors when doing a chain of calls. On this topic I came up the following snippet of code. err := controller() stack := []error{err} for len(stack) > ...
Score of 2
0 answers
102 views

My goal is to apply an Overlay to an Openapi Document. The Overlay Specification exemplifies the usage of "traits". E.g.: given the following document: openapi: 3.1.0 info: title: API with ...
Score of -1
0 answers
69 views

The following test fails on golang , because the library "github.com/grahamgreen/phpserialize" wrongly escapes single quote characters. The working library which does not produce an error ...
Score of -1
0 answers
120 views

Can anyone give me any idea how to implement this system inside a adnetwork ! I have the implementation for DSP with open RTB 2.5. But now I want to redirect my unused inventory/request to other SSPs. ...
Score of 1
0 answers
117 views

I have an Elixir module in which I am trying to call out to Pdfcpu to modify existing PDFs. Pdfcpu is written in Go and has a CLI and an API, and I am trying to use the API. I am using Wasmex to run ...
Score of 0
1 answer
175 views

So, I am implementing a Block Storage Engine in Go and go stuck at the Database part to store Manifest (file) information and an Index Table (a map to store each block information). I was thinking of ...
Score of 1
1 answer
193 views

I'm trying to use a generic function to make a value, conforming to a specified interface. It won't compile because one of the methods takes a pointer receiver. Code: package main // implyType is one ...
Score of 0
1 answer
207 views

I am coding a server in GoLang that allows multiple clients to connect to it and each time a client sends a message to the server that message is propagated to all of the other clients. I came up with ...
Score of 0
0 answers
100 views

In Go 1.24.0 there is an additional parameter in x509.VerifyOptions to be included when verifying X.509 certificate. The problem is that if my X.509 ceritificate doesn't contain any policies or ...
Score of 0
2 answers
103 views

I have a generic struct that requires passing a generic type that fulfills the constraints where the value is comparable so I can use it in a map index, and the value implements Scanner, ie. type ...
Score of 0
1 answer
164 views

I'm in the process of learning Golang, and I'm currently trying to create a Todo project. My knowledge is limited to the GO base. Please take a look at my code and tell me how I can delete a task. The ...
Score of 0
4 answers
283 views

After working on several Rust projects with AI assistance, I want to share a division of responsibility that has worked well in practice, and ask whether others have found the same — or a better ...
Score of 3
0 answers
177 views

I want to create a new struct embedding original struct. But if original struct has comment, it gets placed in the middle of embed struct declaration. Example code: https://go.dev/play/p/8xqxpmNy2Qj ...
Score of 1
1 answer
114 views

Given a package layout as follows: . └── pkg └── pkg1 ├── a.go ├── b.go └── pkg1.go It's possible to write documentation for the package declaration that appears in the ...
Score of 2
1 answer
173 views

I'm observing a strange behavior in Go where the presence of a fmt.Printf statement affects the boolean result of an interface comparison. Env: go version go1.25.6 darwin/amd64 package main import &...
Score of 0
2 answers
179 views

I'm trying to build a Go package in Flathub's CI for an aarch64 Linux architecture. The build is failing while compiling a C dependency: # github.com/rclone/rclone /usr/lib/sdk/golang/pkg/tool/...
Score of 1
0 answers
243 views

I want to debug my go code which is mounted into a docker container. Delve is installed inside the container. I am using goland by jetbrains. Everything works fine as long as I don't use the container ...
Score of 0
7 answers
472 views

I’m planning to start learning System Design, but I’m a bit confused about which programming language I should focus on for it. Most of my experience so far is with C++ and JS, but I often see people ...
Score of 0
1 answer
91 views

Considering the following code, I expect the call to return an error when the Etag that is provided is the same as the remote one. But when testing it does not really matter if it match or not. func (...
Score of 0
0 answers
125 views

Problem I'm using the BigQuery Storage Write API (Go managedwriter package) to upload data to three tables with very different ingestion rates: Table Frequency Record Size A ~10 records/sec Several KB ...
Score of 1
1 answer
100 views

I have a Golang project, a single page application in React, where golang works as static files server and API. The application can be run using docker compose up and npm run in the web folder. Here ...
Score of 0
3 answers
161 views

I see everyone is doing the same project ecom or some learning platform, streaming platform or social media. can anyone suggest me a unique one. I am a fresh go-lang developer (has done ecom as my ...
Score of 0
1 answer
129 views

I am working on a project whereby I want to access the individual words in a file and not the individual character eg. "Welcome to my world" should be equal to "Welcome" "to&...
Score of 0
4 answers
176 views

I wrote an open port scanner in Go. For local adresses scans are instant. However, when I scan an external address it takes a bit longer, and I want to see the progress. I tried to implement a ...
Score of 2
0 answers
110 views

I am developing an RPC streaming endpoint in Go with RPC code generated through thrift. I am having an issue where clients aren't receiving my send calls when optional values aren't provided in my ...
Score of 0
0 answers
147 views

We have a golang web application which is using msedgedriver.exe to convert HTML to PDF. For each user session we create a new Edge Webdriver and Quit when the session terminates. Our problem is, that ...

1
2 3 4 5
1490