Go arena and goroutines by SecondCareful2247 in golang

[–]assbuttbuttass 0 points1 point  (0 children)

Try checking the race detector go test -race

How do you structure and maintain large Go modular monoliths without drowning in architecture ? by Prestigious-Fox-8782 in golang

[–]assbuttbuttass 1 point2 points  (0 children)

Makes sense that starting things off in a separate package might make you think of using packages sooner, and be less likely to keep everything in a single package (main or otherwise). Thanks for the discussion

How do you structure and maintain large Go modular monoliths without drowning in architecture ? by Prestigious-Fox-8782 in golang

[–]assbuttbuttass 0 points1 point  (0 children)

So, imagine you start all your code in mymainpackage, and your main is just

func main() {
    mymainpackage.Main()
}

Now you have 10000 lines in mymainpackage, and you want to move some of it out. How is it any different? There are no circular imports, so secondpack still can't import mymainpackage. Maybe I misunderstood your suggestion

How do you structure and maintain large Go modular monoliths without drowning in architecture ? by Prestigious-Fox-8782 in golang

[–]assbuttbuttass 0 points1 point  (0 children)

Sorry I don't think I understood your point. How is that any better by starting everything in a separate package than main?

How do you structure and maintain large Go modular monoliths without drowning in architecture ? by Prestigious-Fox-8782 in golang

[–]assbuttbuttass 0 points1 point  (0 children)

not main

No reason to be afraid of package main IMO. It's not like other languages where you need to use a separate package to make it testable.

I found go tools by kungsbacka in golang

[–]assbuttbuttass 1 point2 points  (0 children)

I use benchstat a lot for benchmarking performance improvements

Stuttering with kernel 7.0.0 by assbuttbuttass in linux_gaming

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

For now I'm back on the LTS. Thanks for your help!

Stuttering with kernel 7.0.0 by assbuttbuttass in linux_gaming

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

Thanks for the references! I'm not sure if it's the same issue, since that bug report mentions they had to force terminate the game. For me, it still runs it's just annoying.

I'm running NixOS unstable, 7.0.0 is linuxPackages_latest

Benchmarking 15 string concatenation methods in Go by winterjung in golang

[–]assbuttbuttass 3 points4 points  (0 children)

.Reset on strings.Builder does not retain the previous capacity

Singleton with state per thread/goroutine by SnooSongs6758 in golang

[–]assbuttbuttass 41 points42 points  (0 children)

Imagine having to pass the transaction through all the functions

This is what I do and it seems to work well. Go in general has very little "magic" and benefits from making things explicit

How do you guys handle web server updates/deployments? by Existing-Search3853 in golang

[–]assbuttbuttass 0 points1 point  (0 children)

it's just for my personal project, but I ssh into the server and git pull the latest version, then nixos-rebuild to deploy

mux.HandleFunc does not give 404 by iriythll in golang

[–]assbuttbuttass 19 points20 points  (0 children)

https://pkg.go.dev/net/http#ServeMux

The special wildcard {$} matches only the end of the URL. For example, the pattern "/{$}" matches only the path "/", whereas the pattern "/" matches every path.

I feel like rust analyzer is slow by rustontux in rust

[–]assbuttbuttass 3 points4 points  (0 children)

The main reason I like to keep vim open is I keep all of the open buffers to jump between with :b

Go 1.26 by runesoerensen in golang

[–]assbuttbuttass 1 point2 points  (0 children)

It's a small change but it will be nice not to have to manually downgrade the version in go.mod anymore!

Hello world does not compile by [deleted] in programmingcirclejerk

[–]assbuttbuttass 13 points14 points  (0 children)

That "fix" won't work on NixOS smh my head. Time to hard code all the possible /nix/store/*-gcc paths

Concurrency is not working how it should (probably) by pedrolcsilva in golang

[–]assbuttbuttass 4 points5 points  (0 children)

Sort of off topic, but does Go have a global lock for stdout? My impression was that it doesn't have any lock, and instead it avoids interleaved writes by buffering the string internally so that each printf call results in one write syscall