74,499 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
0
votes
0
answers
24
views
How can I make the custom type (Decimal struct that wraps math/big.Int) display correctly in VSCode or Delve debugger?
I have a custom type defined as follows:
// Package link: https://github.com/shopspring/decimal
//
type Decimal struct {
inner decimal.Decimal
}
decimal.Decimal wraps math/big.Int internally.
...
0
votes
0
answers
29
views
Adding new Flag to urfave CLI Tool Breaks Existing Flag
I am building a CLI tool for docker compose to selectively exclude some containers from running/stopping operations (from a docker-compose.yaml having many containers, user can specify the containers ...
-2
votes
0
answers
66
views
Condition contains in nginx.tmpl [closed]
I am trying to create a custom conditional using the contains function, as shown in this code.
### begin ssl_certificate
{{ if (contains "health.co.id" $cert) }}
ssl_certificate /etc/...
-4
votes
0
answers
59
views
"Undefined function g" when role created via enforcer's API
Using casbin RBAC in Go, if I created a new role via enforcer's API, without LoadPolicy() by hand, later when I access some API, will get error:
Undefined function g
I must call LoadPolicy() by hand,...
Eric's user avatar
- 25.8k
0
votes
0
answers
80
views
How can http.Server be made to hold open a connection?
I'd like to add a unit test for Go's http.Server.Shutdown() timing out, but there are no connections held open when the shutdown signal is sent, so it never gets to checking for timeouts, even though ...
-1
votes
1
answer
95
views
How to correctly pass dynamically built command arguments to exec.Command in Go?
I am building a CLI tool for docker compose to selectively exclude some containers from running/stopping operations (from a docker-compose.yaml having many containers, user can specify the containers ...
-2
votes
0
answers
79
views
How to prevent resource leaks in Go (based on given TCP connection example)? [closed]
I've been playing with a very simple TCP server in golang (net.Listener + net.Conn). Within my code I open a TCP connection and pass it to a goroutine to read data from it. In that goroutine, I think, ...
1
vote
0
answers
44
views
"swaggo init" reports the error: cannot find type definition: dto.ArticleModelCreateParams
The command I executed:
swag init -g cmd/server/main.go --parseInternal --parseDependency
My project structure:
/cmd
└─ server/main.go
└─ server/wire.go
└─ server/wire_gen.go
/internal
└─ app
...
2
votes
0
answers
48
views
Cloud Task sporadically responds with 403
When scheduling Cloud Tasks in GCP from within a Cloud Run Function I sometimes (~40% of the time) get a 403 error once the Cloud Tasks runs (the second internal Cloud Run Function). I generate an ...
0
votes
0
answers
81
views
Why is go build trying to download local code, but only in gitlab
We have a project with 3 git repositories, let's call them backend, ui and library, hosted at gitlab.com/mycompany. These build quite happily.
I am trying to move the three repos into one, so we now ...
Pete 's user avatar
- 1,321
1
vote
1
answer
54
views
Go terraform unrecognized import path from GCP Artifact Registry
I get an error when trying to download private go dependencies from artifact registry via terraform:
│ Error: Error waiting to create function: Error waiting for Creating function: Error code 3, ...
Best practices
1
vote
0
replies
39
views
Where should I create the application session when using an internal SSO (Gin + OAuth2)?
I’m integrating an internal SSO (OAuth2) into a web application using Gin (Go), and I’m a bit unsure about the right place to create the application session.
The SSO is the only authentication ...
0
votes
0
answers
60
views
How do I use the Terratest shell module? [closed]
I’ve been trying to use the Terratest shell module to execute bash commands, but I haven’t had much success. Documentation appears to be limited, and most references I found were via AI tools. Below ...
2
votes
0
answers
42
views
inlay hints don't work for golang in neovim?
i have hints working for lua, but not for go.
i've already tried a bunch of stuff like several go configs, though it seems like it is a server problem, because Settings: {} is what i get in ...
1
vote
0
answers
35
views
Trouble decrypting CiphertextForRecipient after KMS GenerateDataKey
I'm building a route for my go (gin) server that generates a Data Encryption Key (DEK), following the principle of zero-trust (the backend never sees the plaintext).
Right now, the client generates a ...