18 subscribers
40 photos
7 videos
2 files
54 links
In this channel, I will wrote my personal thoughts, experiments on different PLs and mathematics
Download Telegram
Finally, I could configure nix development shell with proper LSP support for Go compiler. It was not easy as a beginner nix user. After 4-5 hours researching I decided to see nixpkgs.go_1_25 package and got frustrated from that. Because it was an easy task 😮‍💨

Anyways, I did that! And I am ready to contribute some Go code. Now I am looking through issues page to find easy one to start

https://gist.github.com/abdivasiyev/792939fc4d961b4ad049e7ebb8d8bcf8
Working in a team is nightmare for an introvert people like me I think. Just I want to work in a quiet without any questions, but it is not possible 😥
AoC Day 3 Part 2 is so crazy
A few days ago, I had to use sqlc to generate Go code from sql queries and there was a lack of overriding named parameter types. So I couldn't do anything without it. And after some research I saw sqlc's plugin system and understood how to add my custom overridings. And it was a usefull. Now I am writing only sql queries to generate my repository layer.

https://github.com/abdivasiyev/sqlc-gen-go/commit/c65fe5fa9f63528a46af3cfcc7ec833677bfac46
now my neck is resting finally
🏆1
The passkeys are the beauty of security. You just enter your device's password and don't need to pass any password into websites. I don't know it is how secure, but great for users with its UX
Sometimes I see that a young generation writes a comment for a post like this: where? why? how?

But actually, answers to these questions were written down in the post or an article. I don’t know it is mental issue or a laziness to read something long or something else…
Goroutine leak profiles¶

A new profile type that reports leaked goroutines is now available as an experiment. The new profile type, named goroutineleak in the runtime/pprof package, may be enabled by setting GOEXPERIMENT=goroutineleakprofile at build time. Enabling the experiment also makes the profile available as a net/http/pprof endpoint, /debug/pprof/goroutineleak.

The following example showcases a real-world goroutine leak that can be revealed by the new profile:

type result struct {
res workResult
err error
}

func processWorkItems(ws []workItem) ([]workResult, error) {
// Process work items in parallel, aggregating results in ch.
ch := make(chan result)
for _, w := range ws {
go func() {
res, err := processWorkItem(w)
ch <- result{res, err}
}()
}

// Collect the results from ch, or return an error if one is found.
var results []workResult
for range len(ws) {
r := <-ch
if r.err != nil {
// This early return may cause goroutine leaks.
return nil, r.err
}
results = append(results, r.res)
}
return results, nil
}
λ
The usage of pointers so so crazy in Golang. To find this line, I have spent 2 hours of debugging 🥲.
When you realize your implementation don’t solve anything, just chill and wait someone to solve this issue

😶‍🌫️😶‍🌫️😶‍🌫️

It is because the source actually somehow trash. You can’t understand anything easily
when you love transfer money to yourself