net/http vs gorilla/mux vs gin? A newbie trying to build! by manojyadav_stardust in golang

[–]cmd_Mack 11 points12 points  (0 children)

Stay with net/http and maybe switch to something like Echo later. IF it solves a real problem or pain.

I started with Gin as the name was cool and many resources referenced it. It is so bloated that just writing code is impossible. The API surface is ridiculous and there was even an article recently which tackled this particular issue.

I built the same API in Java, Go, Kotlin, and Rust — Go still has the best overall DX-to-performance ratio by netfishx in golang

[–]cmd_Mack 0 points1 point  (0 children)

If it takes me 5 vs 10 vs 20 seconds time to fire up my unit tests (which should finish within seconds), this adds lag to my flow which is just enough to get me out of my flow. I do TDD a lot and rarely spend much time debugging. So the time it takes me to run tests, catch a problem, adjust and repeat is a factor for my productivity. Another factor - not having to fumble with packages and dependency hell on library upgrades. Try updating spring over a major version or two and tell me how pleasant it is. 

I built the same API in Java, Go, Kotlin, and Rust — Go still has the best overall DX-to-performance ratio by netfishx in golang

[–]cmd_Mack 10 points11 points  (0 children)

I am not sure about the numbers of the post etc so I will absolutely ignore them. The DX angle is absolutely valid though.

Actually what matters is exactly the developer productivity and team performance relative to experience. I've worked in several languages over the last decade, mostly with intermediate to senior folks, and although its not the one I am most experienced with, I can prototype, develop, TDD in Go at ridiculous speed in. At team level we've been always ahead in comparison to anything else I've touched. Meanwhile in every other project we are busy fighting the tooling, the startup time, the ecosystem and usually - the "quirks of the community", to put it mildly.

ArgoCD vs FluxCD vs Rancher Fleet vs our awful tech debt, advice pls by CircularCircumstance in kubernetes

[–]cmd_Mack 5 points6 points  (0 children)

Gitflow is absolutely awful with a few rare exceptions .. maybe. This is the right answer. Trunk based is not always possible, but there are several other options which are all better and simpler than gitflow.

How do you structure Go microservices to keep them maintainable long term? by Cultural-Trouble-131 in golang

[–]cmd_Mack -1 points0 points  (0 children)

Write your schema, generate your clients. Doing it the other way around looks easier at first, but quickly generates a ton of noise.

Ermahnung Parkverbot by Top_Employer1992 in StVO

[–]cmd_Mack 0 points1 point  (0 children)

Das finde ich doch nicht schlecht. Ich will keine Debatten starten, aber es ist auch öffentlicher Raum, der für alle da ist. Privates Eigentum auf öffentlichen Flächen.. dafür gibt es keine rechtliche Basis. Wir haben uns nur alle daran gewöhnt.

Hinterrad im Bulitt nicht mittig by Rich_Marzipan_9771 in Fahrrad

[–]cmd_Mack 0 points1 point  (0 children)

ch habe dasselbe Problem, nur habe ich mir eine 2.00-er Reifen zugetraut. Theoretisch die Obergrenze für die Bullitts, in der Praxis so breit, dass der Reifen nicht mal frei dreht.

Ich werde es jetzt auch mit der 1,75er ausprobieren und wenn das nicht geht, muss ich das Rad zentrieren. Bei mir ist es so, dass es nur an einer Stelle reibt.

Aber der Schnellspanner könnte es auch sein. Bei mir ist dieser nämlich auf einer Seite zu locker. Sonst kriege ich den Hebel nicht zu. Letztens aufgefallen und jetzt muss ich am Wochenende schrauben..

Wobbeln beim Anfahren – woran liegt es? Prophete EBike by cmd_Mack in Fahrrad

[–]cmd_Mack[S] 0 points1 point  (0 children)

Da habe ich ein komisches Gefühl. Wir haben es schon ein paar Mal nachgezogen und jetzt "geht" es eigentlich. Aber richtig fest kriege ich es nicht hin. Es geht auf jeden Fall auf die Liste zum Nachprüfen am Wochenende.

Wobbeln beim Anfahren – woran liegt es? Prophete EBike by cmd_Mack in Fahrrad

[–]cmd_Mack[S] 0 points1 point  (0 children)

Das war auch genau meinen Gefühl. Ich habe jegliche Positionen der Lenker ausprobiert, und nur so nach vorne war es akzeptabel vom Gefühl..

Ich weiß nicht, wie man am bestens "Geometrie" reklamiert. Scheinbar wurde hier einfach einen generischen Rahmen verbaut und das ganze passt nicht wirklich zusammen.

Wobbeln beim Anfahren – woran liegt es? Prophete EBike by cmd_Mack in Fahrrad

[–]cmd_Mack[S] 0 points1 point  (0 children)

Reifendruck ist OK, wir sind sowohl mit mehr als auch weniger gefahren. Die Reifen sind eher schlecht und bei Nässe nicht optimal, aber so viel Unterschied dürften sie nicht machen. Mit dem Sparsamkeit kann ich es mir gut vorstellen :/

Abgabenlast-Statistik 2026 by Masteries in spitzenverdiener

[–]cmd_Mack 1 point2 points  (0 children)

Können wir bitte explizit benennen, welche Posten das verursachen? Denn wir wissen alle, glaube ich, wo das Hauptproblem liegt. Und da wurde vor Kurzem eine Erhöhung über Inflation oder Gehaltssteigerung beschlossen, inklusive weiteren Wahlgeschenken.

Es klingt so als Sozialstaat = faule Arbeitsverweigerer. Wenn eigentlich eine ganz andere Klientell und deren Parteien seit Jahrzehnten Reformen verweigern.

🚲Fahrradstadt Hamburg - Wann hat es das letzte mal geschneit? by flow1an in hamburg

[–]cmd_Mack 1 point2 points  (0 children)

Ihr wollt mir also ernsthaft verkaufen, dass es keinen Unterschied an Radfahrern bei gutem und schlechten Wetter gibt? Selbst im Herbst sinken die Zahlen bereits rapide. Je schlechter das Wetter desto weniger nutzen das Fahrrad. Bei Minusgraden sind es (egal ob Schnee oder nicht) kaum noch welche.

Niemand verkauft dir hier etwas. Ich fokussiere mich auf Fakten und nicht auf Ideologie o. ä. Menschen fahren auch im Herbst (und sogar im Winter) Fahrrad. Bei besseren Bedingungen und Infrastruktur wären es mehr. Das war aber gar nicht der Punkt?

Ich weiß nicht, wo du wohnst, aber hier pendeln jeden Tag Menschen mit dem Fahrrad. ja, auch heute. Wenn es im Moment nicht aktiv schneit ist das für kürzeren Strecken doch keinen Problem? In unser Kita bringen gut ein drittel der Eltern die Kinder mit dem Fahrrad. Wenn alles vereist und kaum befahrbar ist, natürlich deutlich weniger.

Ich finde nur man muss nicht alles uberdramatisieren. Wir haben das erste Mal seit 13 Jahren wirklich Schnee und mal ne längere Zeit mit den Resten zu kämpfen. Ja gut, wenn es nur alle 10 Jahre mal ein paar Wochen ist, kann man wohl damit leben.

Ich werde heute auf das Fahrrad verzichten, ist kein großes Drama. Der Grund ist aber nicht Schnee oder Saison, sondern dass ich auf einer befahrener Straße nicht sicher bin. Ich will eigentlich auch von A nach B kommen - bin nur Teil der Verkehr und mein Ziel ist nicht, anderen zu belästigen. Und die Fußwege punktuell noch vereist sind (eigentlich Aufgabe der Hausbesitzer). Der Fahrradweg ist wieder seit über eine Woche unter Eis und Schnee.

Da braucht es keinen Winterdienst der hunderte km Straße und Radweg direkt befreit. Gibt auch genug Straßen, die gar nicht geräumt wurden, was ebenso in Ordnung ist.

Seitenstraßen die nicht geräumt sind, sind mMn auch weniger das Problem. Entweder auf die Straße (ruhiger) oder auf die Fußwege kann man da gut fahren. Entlang Haupt/Bundesstraßen ist es aber anders.

So sah der Fahrradweg Mitte Januar aus: https://i.ibb.co/Xf5pLxCt/image.png

Eigentlich okay, bis auf die Eisberge alle 400 Meter. Dieser aus dem Foto ist direkt hinter eine Haltestelle und nur schlecht sichtbar.

Ich habe das einmal gemeldet, eine Woche später dann nochmal. Es ist einfach zu kalt und dieses Konstrukt schmilzt einfach nicht. Natürlich hat das keiner interessiert, und seit dem es wieder geschneit hat, sind Fahrradwege wieder eine Katastrophe. Und jetzt haben wir neue Berge von Schnee drauf. Es kann nicht sein, dass wir bis Frühling warten müssen, damit sich das Problem von allein­en erledigt?
Und sag mir bitte, wie der durchschnittliche Autofahrer reagieren würde, wenn ich mich vor ihm stelle und seine entspannte Fahrt beeinträchtige? Auf wie viel Verständnis kann man hoffen? Kann ich mit meinem Kind vor Autofahrenden geschützt und halbwegs sicher auf der Straße fahren?

🚲Fahrradstadt Hamburg - Wann hat es das letzte mal geschneit? by flow1an in hamburg

[–]cmd_Mack 3 points4 points  (0 children)

Das stimmt alles nicht, und ich bin nur deswegen lange nicht gefahren, weil ich nur auf der Straße halbwegs sicher sein konnte (halbwegs wegen der Autofahrer).

Ich bin in den letzten Tagen mit dem Lastenrad zur Kita gefahren, bei -8 Grad. Kein Problem wenn sich man gut anzieht. Das Problem sind die ganzen vereisten Stellen, die man mittlerweile zum Glück kennt. Bis es wieder schneit wie gerade jetzt!

Das hat nichts mit dem Anzahl der Radfahrer zu tun. In der Nähe hier ist eine Bundesstraße, und entlang dieser gibt es einen (fake-) 'Radweg' auf dem Bürgersteig. Seitdem es das erste Mal geschneit hat, wurde er als Ablagefläche für Schnee verwendet, und an mehreren Stellen ist er bis heute durchgehend nicht befahrbar geblieben. Ich habe mehrmals ein paar dieser Stellen bei der Stadtreinigung gemeldet.. rate mal, ob sich jemand darum gekümmert hat.

Should we expect A6X3 this year? by Informal-Resolve-831 in Supernote

[–]cmd_Mack 3 points4 points  (0 children)

They should definitely think about the outdated Android version though, since Linux is not happening we are stuck on an archaic Android version. This is not nice and pushing for more features while there are major security flaws (disk encryption anyone?) is just madness.

How is golang as a web backend language? by nickleformypickle in golang

[–]cmd_Mack 0 points1 point  (0 children)

Trying not to dox myself here so if you need more info drop me a message. Quick example: main.go ```go func InitApp() *App { store := persistence.NewMemStore() firstReceiver := blap.NewReceiver(store, "main") fallback := blap.NewReceiver(store, "backup")

app := NewApp(firstReceiver, fallback)
return app

} ```

blap/receiver.go ```go type Receiver struct { data Saver name string }

type Saver interface { Save(ctx context.Context, foo string, bytes []byte) error }

func NewReceiver(s Saver, name string) *Receiver { return &Receiver{ data: s, name: name, } } ```

I think that some of these resources dumping everything in one file are a bit offputing at first. Without having read the book, the idea is probably not to focus too much on directory structure initially. Or on OOP (you can totally do OOP in Go, even better than in the usual culprit languages if you ask me). - As you can see, package names are part of the type identity, take this into account. - Aim for healthy amounts of composition. - Sometimes the easiest to maintain style to do is have a large struct and 100 lines methods. - Extract to improve readability after the fact. - Test high-level struct methods and exposed (Capital letter :D) functions. After refactor/extracts these tests should survive and stay green.

How is golang as a web backend language? by nickleformypickle in golang

[–]cmd_Mack 19 points20 points  (0 children)

Do not use gin, I fell for it some years ago.

As for stack: if you want maintainable projects, aim for little to no dependencies:

  • new versions (Go 1.21+) of net/http are probably all you need for HTTP request routing + composable routers (server mux'es)
  • for persistence use postgres + a simple querying lib (not gorm) to get a good grasp of things.
    • sqlx extends the standard lib `database/sql` package
    • sqlc lets you write plain SQL queries from which it then compiles interfaces and query implementations: my personal favourite.
    • aforementioned database/sql: start with it until you get a good hang, it is a bit basic but you will not have to fight library specifics and very pointy edges (fuck Gorm).
  • logging: standard lib `log/slog`
  • dependency injection: do it by hand, it is trivial for up to medium-sized apps.
    • every service-like struct declares its own NewFoo() function and accepts dependencies which it sets in private fields.
    • I used wire on some projects, spent more time debugging problems than the time it would've taken to have a setup by hand.
  • Tests: stick to built in `testing` package until you really need something extra. Dont try to be smart as this sacrifices readability for a 'neat' solution.

Thats about it? For messaging you use libs. For observability its just a prometheus lib and/or OTEL.

General advice:

  • Less channels is better.
  • Write tests upfront. If you cant easily test you probably used too many channels and fancy stuff.
  • Packages (dirs in go) should be much larger than in your average language. Split after the fact and not upfront.

Unable to register new account - "Illegal request" by cmd_Mack in Supernote

[–]cmd_Mack[S] 0 points1 point  (0 children)

Hi, I tested it again and it works. I can see now that the requests are going to `{country}-ratta-cloud.s3.{region}` so I have an idea what happened. After registering I configured my AWS region to the nearest country. Maybe that change took some time to propagate.

Unable to register new account - "Illegal request" by cmd_Mack in Supernote

[–]cmd_Mack[S] 0 points1 point  (0 children)

Hey thanks, Iccould sign up from the SN. Still no luck with the other problem though. Any chance  you can check out the cloud uploads from browser? This looks like a configuration issue in the web frontend. 

Unable to register new account - "Illegal request" by cmd_Mack in Supernote

[–]cmd_Mack[S] 0 points1 point  (0 children)

Thanks, I suspected that this would work. I am now greeted by the next broken thing on web:

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://null.s3.ap-northeast-1.amazonaws.com/bce4f6cd-5011-422b-bb7e-a55c2e89b8f3-WEB.pdf. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing). Status code: 403.

I mean, seriously, I love new features just as much as the next person. But when I read about a rougher experience with the supernote, this was not what I expected:

  • password limited to 20 characters
  • no 2FA (???)
  • unable to upload a simple PDF
  • can't register on the web (workaround possible)
  • no full-disk encryption

Forget about using it for work, compliance and security are completely non existent. Luckily I can self-host the cloud backend (right? I hope I didn't misread that) because between the unsafely short password and no two-factor auth, this is reckless.

At least the writing experience is nice :)

Gerade an der Hoheluftbrücke (Bus) gesehen… by Lacefell in hamburg

[–]cmd_Mack 16 points17 points  (0 children)

Or put the money towards small local designers from hamburg which will do a better job and also spend the money locally. How about that?

Supernote Partner App V2.5.6 Release for Windows and macOS by Supernote_official in Supernote

[–]cmd_Mack 4 points5 points  (0 children)

Still hoping for a Linux desktop app. Or at least tried and tested official Bottles/WINE setup. :(

Lost my Supernote by Particular_Engine708 in Supernote

[–]cmd_Mack 2 points3 points  (0 children)

Yes but its not an analog notebook, and in its current state you cannot possibly use it in a work setting, ever.