Questions tagged [go]
Go is an open-source programming language, with a syntax loosely derived from C. It's statically typed, with limited dynamic typing capabilities; it also features automatic memory management, built-in concurrency primitives, variable-length arrays – called slices –, and a large standard library.
73,402
questions
0
votes
0
answers
14
views
Do daughter child die if their parent dies in Go?
I'm writing a web server to handle websockets in Go, so, I have the following code:
func StartComunication(
ctx context.Context,
userID string,
connectionRepo ports.ConnectionRepository,
) ...
-1
votes
1
answer
24
views
How To Unit Test Receiver Function That Uses Another Receiver Function
Let's say you have the following
type Person interface {
GetFullName() string
PrintName()
}
type Banker struct {
FirstName string
LastName string
}
func (b Banker) GetFullName() string {
...
-1
votes
1
answer
24
views
Variable used inside function reported not used
This works fine:
package main
var foo string
func main() {
fn := func() {
foo = "AAA"
}
fn()
}
But if we move the variable declaration inside main():
package main
...
0
votes
1
answer
24
views
libwebp Undefined symbols for architecture arm64: _SharpYuvConvert
Trying to compile the go-webp package using Bazel. This involves compiling libwebp from sources.
Here's how I'm retrieving libwebp's sources:
# WORKSPACE
git_repository(
name = "libwebp",...
1
vote
0
answers
16
views
How to correct a condition according to site lang with Hugo cms?
Hello everyone and thank you for taking the tile to help me.
I need to do a condition according to the language of a website.
In the following partial i need tp display an aria label according to the ...
1
vote
2
answers
49
views
Need help in preventing multiple crons/scheduler running in golang
I'm working on a Go microservice where I am using robfig/cron package to schedule jobs, initially thought of using time.Ticker() but package made it easier for me.
My question is how to ensure cron ...
-1
votes
0
answers
17
views
The following problem occurs when using harbor's oidc [closed]
**
I have tested it and the oidc server is working.. **
Problem
INTERNAL_SERVER_ERROR","message":"failed to verify signature: failed to verify id token signature
/harbor/src/lib/...
-2
votes
0
answers
20
views
Golang test cases for gin failing [closed]
Hi All I am trying to create a test cases for my gin gonic framework where I am using Gorm and ORM but I am getting errors like this:
[31m2024/07/03 08:48:19 [Recovery] 2024/07/03 - 08:48:19 panic ...
0
votes
1
answer
26
views
Inject default Context into go-grpc server (e.g. logger injection)
The golang go-grpc grpc.NewServer(...) call appears to lack any means to inject a default context.Context that should be inherited by all server gRPC call handlers.
Is there a sensible and simple way ...
-1
votes
1
answer
31
views
Cannot import go-gl library - "build constraints exclude all Go files"
I'm very new to golang, sorry if this is obvious. I've followed the steps from the project Github, and here is my exact procedure (with error):
$ go mod init mydomain.com/test
$ go mod tidy
$ go get -...
0
votes
3
answers
45
views
Same struct in two different packages Golang
I have this piece of code:
import (
"github.com/golang/protobuf/proto"
"github.com/hyperledger/fabric-protos-go/common"
"github.com/hyperledger/fabric-protos-go/...
1
vote
0
answers
24
views
Scrape PDF in golang
Hi can anyone help me how can I use https://pkg.go.dev/github.com/pdfcpu/[email protected] to extract human readable String via scrapping a pdf.
FYI I am using AWS lambda:
Here is my code snippet:
package ...
-4
votes
2
answers
46
views
why nil is valid for any but not [T any]?
from Return default value for generic type
You can't return nil for any type. If int is used as the type argument for T for example, returning nil makes no sense
ain't these two statements ...
2
votes
2
answers
25
views
Building with Fyne - cannot find -lopengl32: No such file or directory
I'm trying to set up an application using Fyne, starting with just the basic template it gives. However, when building the application I get this message, and nothing runs:
PS C:\Users\kmall\OneDrive\...
1
vote
1
answer
35
views
GORM Help w/ Postgres: unsupported data type [closed]
I'm trying to read through the CVE List to put all the entries into a central database. When I try to create an entry to this databse, I get an error: 2024/07/02 14:03:13 /x/db.go:68 unsupported data
...