Skip to main content
The 2025 Developer Survey results are in. Explore insights into technology and tools, careers, community and more. View results.
0 votes
0 answers
55 views

What is the correct way to iterate through a JSONL reader with jsonv2

Consider this demo example: import ( "bytes" "io" "log/slog" "github.com/go-json-experiment/json" "github.com/go-json-experiment/json/...
Dave Butler's user avatar
  • 1,861
0 votes
1 answer
41 views

How do I change the indent of a YAML sequence in goccy/go-yaml?

I have a YAML file which starts out like this: additional_hostnames: [] I use goccy/go-yaml to parse it and add a new value like this: newHostnameNode := ast.String(token.New(hostname, hostname, &...
chx's user avatar
  • 11.8k
0 votes
0 answers
19 views

runtime.AddCleanup does not run in golang [duplicate]

Due to application-specificity, I am trying to store either an object or a integer into a single int64 using the code below. However, the GC failed to release the resource. I am not sure where it went ...
khanh's user avatar
  • 653
1 vote
0 answers
64 views

how i can populate struct type only in returning joined column from sql

I have a table named tasks where have relationship one-many to another table (projects), i want to query tasks with projects but only return selected column from the projects table. how i can do that ...
Faizisyellow's user avatar
-3 votes
1 answer
89 views

UDP server in Go doesn't receive calls from Lua client [closed]

I have a UDP server set up in go, that reads from any address and then sends a response, and a client that sends the calls to the server. the client sends the calls successfully, but the server doesn'...
Dr-flimflam's user avatar
2 votes
2 answers
66 views

set bubbletea program on model

I'm attempting to use the bubbletea library in Go, and one of my models needs to send a message when updated, which requires a reference to the bubbletea Program. I'm running into a chicken and egg ...
Rich Remer's user avatar
  • 2,748
-3 votes
0 answers
79 views

Port http server is different but still get response [closed]

I'm currently building a simple reverse proxy where I can forward to the origin server. When the client requests from the reverse proxy, I do not change the header of the request. The request still ...
Faizisyellow's user avatar
-5 votes
0 answers
44 views

Unable to run .go file without admin rights in vs code [closed]

I am new to go and I have written a simple go Lang Hello world code but when I try to run i using command go run hello.go it gives me error. "The application you are trying to run is not ...
Dev_xyz's user avatar
0 votes
1 answer
122 views

golang can't find SOME standard library packages (could not import fmt (open : no such file or directory)) [closed]

I'm new to Go and I'm having a strange problem. It has (I think) little to do with the package I want to change, wrap. It has to do with imports. I'm writing a test program which imports "...
Erik Bennett's user avatar
  • 1,113
-3 votes
1 answer
95 views

How to cancel long-running tasks when a Go HTTP server is shut down? [duplicate]

I'm writing an HTTP server in Go that performs long-running tasks (e.g. data processing or computation). When the server shuts down via srv.Shutdown(ctx), I want in-progress handlers to stop, even if ...
Volodya Lombrozo's user avatar
-3 votes
1 answer
52 views

Generic type constraint match reflect.Type passed [closed]

Could you please help to mercy golang compiler in the following example. I'd like to implement generalized string parser func Value[T reflect.Type](value string, t reflect.Type) T { switch t.Kind()...
Mykhaylo Adamovych's user avatar
0 votes
1 answer
55 views

Error 1045 (28000): Access denied for user ''@'localhost' (using password: NO) exit status 1 [closed]

I am trying to implement the tutorial from https://go.dev/doc/tutorial/database-access on windows 11 machine I have the set variables using the following code in my workspace terminal set DBUSER=root ...
Joyston's user avatar
  • 852
1 vote
0 answers
68 views

Environment variables not accessible in dynamically loaded .dylib on macOS using Rust libloading, but works on Windows

macOS: The dynamically loaded .dylib cannot read environment variables that were set by the main Rust process at runtime Windows: The same code works perfectly - the .dll can access environment ...
leibuyun's user avatar
0 votes
1 answer
105 views

How much stack space is required for saving the function context in Go 1.24?

How much stack space is required for saving the function context in Go 1.24? I wrote an go demo like this: func getStackUsage() { var recurse func(int) recurse = func(n int) { tmp := n ...
Kevin's user avatar
  • 47
1 vote
0 answers
42 views

How to enable auto-refresh for VS Code Explorer and Source Control panes for detecting file changes and updates

When the Go extension is enabled in VS Code, updates to local files are no longer displayed/detected in the Explorer and Source Control panes until manually refreshed. Notes: Disabling the Go ...
Sivan's user avatar
  • 43

15 30 50 per page
1
2 3 4 5
4961