74,501 questions
Advice
0
votes
1
replies
87
views
Project or features suggestion to add to my project to impress company or CEO
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 ...
0
votes
1
answer
91
views
Accessing the individual words of the content a file
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&...
-4
votes
0
answers
43
views
GO file manipulation [closed]
How can I effect a change on more than one word if the number of word is specified.
for example: today is my day (up 2). Where I am to convert the last two words to uppercase
i.e today is MY DAY
Advice
0
votes
4
replies
84
views
How can I safely implement a progress bar in a concurrent Go port scanner?
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 ...
2
votes
0
answers
75
views
Go RPC streaming send not working properly when optional values not provided
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 ...
0
votes
0
answers
69
views
selenium/Edge driver fills up memory in golang application
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
vote
1
answer
76
views
How can I migrate updateOne operation with `UpdateOptions ArrayFilters` from mongo-driver v1 to v2?
I'm trying to migrate this from mongo-go-driver v1 to v2
filter := bson.D{bson.E{Key: "_id", Value: homeID}}
arrayFilters := options.ArrayFilters{Filters: bson.A{bson.M{"x._id": ...
2
votes
1
answer
90
views
protoc3 grpc (go) code generation problem
trying to generate protoc 3 code for my go project. The protoc documentation lists that I can just take the latest version like :
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest and
...
Advice
0
votes
1
replies
82
views
How to stream PostgreSQL (pgx.Rows) query results into a pager (less) without buffering the entire result set?
Im building a PostgreSQL CLI client in Go (pgxcli), inspired by pgcli. I am using the pgx driver, and the app features an REPL, autocompletion, and syntax highlighting.
Currently, the code buffers the ...
-6
votes
0
answers
100
views
What does "top-level value" mean when parsing JSON? [duplicate]
I'm trying to unmarshal a JSON string into a Go struct, but I keep getting the error:
invalid character '}' after top-level value
Here is my code to reproduce this error:
package main
import (
&...
Best practices
0
votes
1
replies
67
views
What additional fields are needed to identify instances of services in metrics, traces, logs - After replicating services across multiple replicas?
After replicating services across multiple instances (replicas), we need to figure out what additional fields are required to identify instances in metrics, traces, logs, and health checks.
For ...
4
votes
1
answer
144
views
Reducing memory usage when writing chunks in order with Go parallel workers
I have a Go function for encrypting data in parallel using AES-GCM:
func encryptParallel(ctx context.Context, aead cipher.AEAD, w io.Writer, r io.Reader, workers uint64) error
The design is:
One ...
2
votes
1
answer
156
views
iteration over integer range doesn't work with generic type constrainted to integer
Go v1.22 added the ability to easily range from 0 to n-1:
// Prints 0, 1, 2 on separate lines.
for i := range 3 {
fmt.Println(i)
}
However, it doesn't work as expected when the expression's type ...
0
votes
1
answer
79
views
Playing raw float32 stereo samples with raylib
I am trying to play raw audio samples with raylib. All examples I can find are with a mono output, and playing a mono signal works fine. However, when I try to play signal, it gets distorted.
...
2
votes
0
answers
130
views
Why does my Go program crash with SIGBUS error when stopping a copied time.Ticker? [closed]
I have the following Go code:
package main
import (
"fmt"
"time"
)
type ticker struct {
ticker time.Ticker
}
func main() {
var t1 ticker
// var err error
...