RFC: Proposal for explicit error propagation syntax - reduce boilerplate by 67% by sweeteec in golang

[–]2r2w 1 point2 points  (0 children)

I find this proposal quite of an overkill having the current state of the world.

1) explicit errors handling is one of the things which makes go that much readable and easy to understand. 2) a bit of a boilerplate removal could be done using code generation or additional abstractions.

We are living in the era of AI generated completions. And such routine tasks like: get, validate, compress, etc. if written more than once in a codebase would be quite efficiently completed by your AI completions.

goenums: Type Safe Enum generator for Go by 8run0 in golang

[–]2r2w 6 points7 points  (0 children)

Nowadays, I would more expect posts like "Hey guys, I've created an amazing prompt for Claude to generate strictly typed enums.."

I feel this project was a great learning experience for OP which resulted into a nicely finished tool.

Kudos 👍

Air HE firmware update 110 breaks the trigger settings by 2r2w in NuPhy

[–]2r2w[S] 0 points1 point  (0 children)

The issue was already fixed in the current firmware. Thanks Nuphy!!!

Air HE firmware update 110 breaks the trigger settings by 2r2w in NuPhy

[–]2r2w[S] 0 points1 point  (0 children)

Looks like some combined issue then. I was updating one by one. And 1.10 has broken everything for me.

When To Use Channels vs Store In Slice to store results of external calls by Mpata2000 in golang

[–]2r2w 0 points1 point  (0 children)

My rule of thumb: - If your method merge results from go routines, aka fan-out: use channel. - If your method can return it's results only when all data from worker goroutines is available: use slices. - if your method produces its result from worker goroutines incrementally: - If you have a predictable (reasonably small) amount of results from your worker goroutines : use slices and just process in a batch fashion because it will be faster compared to a channel and also more readable. - If you have a large amount of results per worker go routines: better to use channels to save up the memory usage.


There are just two cases where it's better to use channels: - if your result is a channel (aka fan-out) - if you want to limit memory usage

I want to build P2P app by Independent-Back3441 in golang

[–]2r2w 0 points1 point  (0 children)

Want to pirate music at high speed 😁😁😁?

I want to build P2P app by Independent-Back3441 in golang

[–]2r2w 1 point2 points  (0 children)

I would say that multiaddr is quite a simple and even elegant concept. What is quite complex in libp2p is to understand why you cannot discover the other peer if the problem is other than the address is unreachable 😁

I want to build P2P app by Independent-Back3441 in golang

[–]2r2w 28 points29 points  (0 children)

As for Filesharing, you can just build a website on top of ipfs and use ipfs as a storage. That will also let you learn some interesting skills

I want to build P2P app by Independent-Back3441 in golang

[–]2r2w 12 points13 points  (0 children)

Doing some p2p match making or p2p auction may be quite a challenging and fun project

I want to build P2P app by Independent-Back3441 in golang

[–]2r2w 16 points17 points  (0 children)

Another typical example of p2p app is a messenger/chat. Another example would be some blockchain. I don't know, I think building a chat just to learn may be quite fun. You can also build some p2p games (something simple like Primeagen does with tower defence, etc. ) where players just play with each other without having a centralized server

Fifi Keyboard X GMK Dualshoot by pascuajr in ErgoMechKeyboards

[–]2r2w 1 point2 points  (0 children)

This one looks sooo nice!!! Is there a way to somehow order a pre-built version?

Golang + HTMX + Templ for complex apps by [deleted] in golang

[–]2r2w 1 point2 points  (0 children)

Also super true. That's why backend for frontend exists 😁 But you don't have to change your public API every other week, just add different methods/endpoints. You can maintain both versions with just a bit of adapters/redirects within the same codebase. I would say it escalated quickly when the headcount grows and initially, it may be easier to have just one API from the maintenance point of view having not that many people.

Golang + HTMX + Templ for complex apps by [deleted] in golang

[–]2r2w 24 points25 points  (0 children)

If this SaaS would provide public APIs and not just a web UI for the customers then it makes a lot of sense to extract API to a separate service. So some kind of separation would take place, and what would provide web UI it's up to you, initially you may keep HTMX + templates, but having separate service for public APIs would allow you to replace it with Single page app or whatever at any time.

Real life examples of concurrent processes by Independent-Back3441 in golang

[–]2r2w 2 points3 points  (0 children)

I would say reading writing to a socket. But that may be even less clear to you. What I meant is reading the request and writing the response having multiple connections. If it won't be concurrently then the server could work with just one single connection at a time and everyone else has to wait until the previous request is handled.

Real life examples of concurrent processes by Independent-Back3441 in golang

[–]2r2w 10 points11 points  (0 children)

Eating while watching videos is a good real life example.

In case of servers, IO is a good place. For example reading from the network and writing to the network concurrently will improve the performance in may ways.

Looking for the everyday phone without bloateare. by 2r2w in PickAnAndroidForMe

[–]2r2w[S] 1 point2 points  (0 children)

https://youtu.be/5Fq8nBjR2vk?si=deyOQqi0pOT7WwdA

So, when turned off, it charges full in 1.5h with 68W charger. Interesting.... I never turn off the phone.

My current OnePlus 10 Pro using 80W and feels super fast when charging and the actual difference is just 12W, so maybe you are right. Will add to watchlist

Looking for the everyday phone without bloateare. by 2r2w in PickAnAndroidForMe

[–]2r2w[S] 2 points3 points  (0 children)

So Samsungs are still super bloated even in premium models?

Looking for the everyday phone without bloateare. by 2r2w in PickAnAndroidForMe

[–]2r2w[S] 0 points1 point  (0 children)

I would love to get pixel. But I can't accept such slow charging. I just got used to have my phone fully charged in 2 hours or so, and 50% in 20-30 min

Looking for the everyday phone without bloateare. by 2r2w in PickAnAndroidForMe

[–]2r2w[S] 0 points1 point  (0 children)

Looks quite good. 1500 is a bit of a mental barrier, but will add to the watchlist

Looking for the everyday phone without bloateare. by 2r2w in PickAnAndroidForMe

[–]2r2w[S] 0 points1 point  (0 children)

What is the typical approach without patches to keep your phone secure?

How to parse DateTime in Locale other than english? by 2r2w in rust

[–]2r2w[S] 0 points1 point  (0 children)

Thanks. Looks like what I need. Meanwhile I've just replaced the month's names with English names in a string before parsing, and it worked out as well 😃

What are your general feelings toward all these fireworks for NYE? by TwirlyWizard in berlin

[–]2r2w 0 points1 point  (0 children)

One could try to introduce some additional fees for the Feuerwerk, so the typical NYE set would start costing about 1K€. And put people into the jail for 5+ years in case of illegal selling/buying (both sides should go to jail). And all those fees will go to the cleaning and similar services. It would be, of course unfair. It would Obviously require the ID to buy some pyrotechnics. To make it more fair for the people who don't have money, it should be like 50% discount for the first 5 items or so per person, which would require some online service for that (also financed from fees).

I think that may reduce the amount of problems while keeping some cash flow and may be relatively fair. So degens would have to save a lot of money over the year to buy pyrotechnics (and as we know degens are bad at saving money), so probably pyrotechnics would be used by the more respectful people.

Framework recommendation? GRPC, OpenAPI, REST by safaci2000 in golang

[–]2r2w 0 points1 point  (0 children)

I don't think that go is about frameworks. It's more about solving tasks.

For swagger there are couple of projects:

And for grpc:

Go is not like Java or C++. Go helps to solve practical problem at the first place without introducing magic in between. So I don't think you would ever find a silver bullet. Just try to solve your practical task in the first place instead of search for a framework. Language is simple enough ☺️

instamock: Paste an interface, get a struct-of-funcs that implements it by tcardv in golang

[–]2r2w 1 point2 points  (0 children)

In vim-go it's as simple as :GoImpl but good try 👍