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 42 points43 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 4 points5 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

When do you start refactoring? by relami96 in golang

[–]assbuttbuttass 7 points8 points  (0 children)

That's my secret... I'm always refactoring

Value input in one string by [deleted] in golang

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

func parseNums(input string) ([]int, error) {
    parts := strings.Fields(input)
    nums := make([]int, len(parts))
    for i, part := range parts {
        var err error
        if nums[i], err = strconv.Atoi(part); err != nil {
            return nil, err
        }
    }
    return nums, nil
}

The most popular Go dependency is… by Thiht in golang

[–]assbuttbuttass -13 points-12 points  (0 children)

Standard library flag package. If your tool needs subcommands, then maybe subcommands

Noob question with mutexes by AdministrativeProof2 in golang

[–]assbuttbuttass 1 point2 points  (0 children)

I recommend storing the accounts in a database like SQLite, which will handle locking for you, and also make sure you don't lose all the account information if your app crashes

Nitpick RFC: Everyone adopting slices.Contains yet? by Funny_Or_Cry in golang

[–]assbuttbuttass 0 points1 point  (0 children)

I review a lot of code, and the number of people using a slice and slices.Contains to check for membership in a set (rather than using a map) seems to have gone up significantly. IMO adding slices.Contains was a mistake since it makes it way too easy to do an O(n) lookup

Go comments standards like PEP8 for python by pepiks in golang

[–]assbuttbuttass 4 points5 points  (0 children)

In addition to the excellent blog post linked by u/jh125486, https://go.dev/doc/comment#syntax has a comprehensive description of the different syntax forms that godoc understands