74,486 questions
0
votes
0
answers
40
views
Why does my Go templates always render the last child template when using template inheritance?
I'm having an issue using template inheritance in go, but all of my routes are rendering the same file from my templates folder, which happens to be my last one (ViewGames.hmtl). Here is what my ...
0
votes
0
answers
19
views
RPC commiunications in Mattermsot plugins and Apache-APISIX plugins, Is RPC only for Golang - Golang?
I’m trying to understand how plugin systems differ between Mattermost and Apache APISIX, specifically in how they use RPC for external plugins.
Mattermost plugins must be written in Go. The server ...
1
vote
0
answers
54
views
I can't query by UUID
I'm having trouble querying UUID values stored as BLOB(16) in SQLite3 using Go (with goqu). I insert a UUID using uuid.New().MarshalBinary() and this works correctly. However, when I try to select the ...
1
vote
0
answers
27
views
How to correctly establish connection with active directory via LDAP in Golang
I have been trying to write a daemon in go to run on linux that would periodically do certain actions, and once some conditions are met, it would connect to AD, and write a value to a given record.
...
Best practices
0
votes
6
replies
80
views
Cancel context after n other contexts got cancelled
Lets say I wanted to create a context which gets cancelled as soon as all of some subcontexts got cancelled. Would this be a valid way to do that, or is there a better option? My idea is, that the ...
Best practices
1
vote
2
replies
50
views
How to write idiomatic Go business logic for CRUD involving multiple tables/models?
I am refactoring my backend where clients can start threads and make replies. I keep a 3-layer architecture with thin handlers that bind and validate, service layer with all business logic, and a repo ...
1
vote
0
answers
40
views
Evaluate Kubernetes CEL Condition locally using Golang
I am creating a Kubernetes controller that needs to modify resources when specific conditions are met. I would like to define my match conditions using CEL expressions in a configuration file similar ...
Best practices
1
vote
7
replies
110
views
Reading all available values from channel in Go
If you want to read all values from a channel ch until it is closed, you can do so with range:
for x := range ch {
// do something with x
}
This will block until ch is closed. I want to read all ...
0
votes
0
answers
85
views
Exported identifiers in Go
The Go spec states: "An identifier may be exported to permit access to it from another package. An identifier is exported if both: 1. ... 2. the identifier is declared in the package block or it ...
Best practices
0
votes
3
replies
65
views
Representing 4 types of Card Templates Adhering to DDD
I have an Entity Called CardTemplate. For physical cards, there will have to be a pattern chosen to physically print the card. And based on the two types of operations that the cards are allowed to do,...
Advice
2
votes
1
replies
56
views
How to redact information in API depending on authorization of client in scalable way?
I am writing a forum-like API and I want to protect private information from unauthorized users. Depending on the role of client that makes a request to `GET /posts/:id` I redact information such as ...
1
vote
1
answer
69
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
54
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
37
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{
...
-2
votes
0
answers
61
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....