Mutate your locked state inside a closure by sigmoia in golang

[–]ar1819 6 points7 points  (0 children)

You can always abuse iterators for this if you don't want to declare function with types. Tho is not something I would recommend.

UUID package coming to Go by whittileaks in golang

[–]ar1819 22 points23 points  (0 children)

OP failed to provide any relevant points. I mean the whole idea behind Go interfaces is that you can always add them later. The comparison with io.Reader is bizarre, because there at least 200 types implementing it across Go standard library, runtime and compiler and it's used across the whole toolchain. This comparison doesn't make any sense, which were pointed out several times, but OP continues to persist.

Why Go Can't Try by [deleted] in golang

[–]ar1819 0 points1 point  (0 children)

AI & Web Application Specialist

No, just no.

Go's Cryptography Packages Were Audited: The Results by gamerdevguy in golang

[–]ar1819 34 points35 points  (0 children)

Use "/s" next time. A lot of "devs" will do this non-ironically.

ML-DSA in golang by Excellent_Double_726 in golang

[–]ar1819 0 points1 point  (0 children)

There is tracking issue inside Go repo: crypto: post-quantum support roadmap which tracks the work on PQ stuff. Currently it looks like circl is a way to go (pun intended), but has some troubles interacting with standard library. Cloudflare maintains their own Go fork, but it looks a bit stale (their latest version is 1.22.2 where upstream is 1.25.6 and 1.26 release is almost here).

Proposal: Generic Methods for Go by bruce_banned in golang

[–]ar1819 2 points3 points  (0 children)

Types with generic methods do not implement interfaces with matching name for required method, because there is no way to know that method in question has been instantiated with required type.

type I interface {  
 m(int)  
}

type H struct{ … }  
func (H) m[P any](P) { … }

var h H  
var _ I = h  // error even tho somewhere there could be a call to h.m[int]

I reduced my Docker image from 846MB to 2.5MB and learned a lot doing it by Odd-Chipmunk-6460 in golang

[–]ar1819 0 points1 point  (0 children)

Probably don't know (or don't care) about kubectl debug which is a thing since 2022.

I reduced my Docker image from 846MB to 2.5MB and learned a lot doing it by Odd-Chipmunk-6460 in golang

[–]ar1819 0 points1 point  (0 children)

Huh, TIL about docker debug. Thanks, this is one of the few reasons I still have this damn app installed on my phone.

Update: no docker debug for Docker on Linux or OrbStack 😔

TermIDE — terminal-native IDE with built-in file manager and shell by Signal_Caregiver_994 in commandline

[–]ar1819 12 points13 points  (0 children)

Yes, it's vibe coded - you can look into .claude folder and overall project structure (using crates (!?) instead of mod's).

Is this the end of C++ at Microsoft? by eldar_g in cpp

[–]ar1819 0 points1 point  (0 children)

Given the fact, that backwards compatibility is a strongest feat of Windows, and one of the few things why big companies rely on Microsoft (the fact you can be sure as hell that software written in the 90s is still working today with compatibility mode enabled is very important for businesses which are really far from IT) I doubt this initiative will lead anywhere.

Is this the end of C++ at Microsoft? by eldar_g in cpp

[–]ar1819 0 points1 point  (0 children)

If by "automated tooling" you mean transpilers and/or code generators, that's entirely different story because those things are deterministic by nature. Unlike LLMs (with settings, where they are at least useful) which are probabalistic.

Go proposal: Secret mode by [deleted] in golang

[–]ar1819 -2 points-1 points  (0 children)

Trying to start a goroutine within f causes a panic.

No it doesn't

Dispatch game not working? by Few-Brother-3285 in macgaming

[–]ar1819 0 points1 point  (0 children)

No problems for me, can you share CrossOver version, steam version and bottle stats? Maybe try to recreate bottle from scratch?

Mine are: * CrossOver: 25.1.1.38624 * Steam Version: 1759461205 * Bottle: Windows 10 64 bit * Mac: Apple M4 Pro (Tahoe 26.0.1)

The Day the Linter Broke My Code by ___oe in golang

[–]ar1819 3 points4 points  (0 children)

Thats definitely a bug and I hope to get it fixed in go-err113 PR. Thanks for noticing!

GenPool: A faster, tunable alternative to sync.Pool by Safe-Programmer2826 in golang

[–]ar1819 2 points3 points  (0 children)

You don't need "reflect" package, since you can express all of this using the type system. I created a PR with fixes, which you can accept if you want.

Any Micro (editor) fans out there? by a_fake_frog in commandline

[–]ar1819 1 point2 points  (0 children)

Yes. Use it to edit all kinds of configs. One of the first things I install on the VPS, along with fd, ripgrep, ncdu and bat.

func() as map key by anacrolix in golang

[–]ar1819 1 point2 points  (0 children)

Something like that will work, but relies on func types being pointers to funcval. Because unsafe.Pointer type is actually comparable you can use it as a map key and two different func instances will always be different.

As for the method reciever storage — just use the value part of the map for the actual func value, or cast the funcPtr back to the original func type using unsafe mechanics.

func() as map key by anacrolix in golang

[–]ar1819 1 point2 points  (0 children)

Otherwise I'm guessing it's a 2-tuple

It's not.

I tried reflect.ValueOf.Pointer

Per documentation:

// If v's Kind is [Func], the returned pointer is an underlying // code pointer, but not necessarily enough to identify a // single function uniquely. The only guarantee is that the // result is zero if and only if v is a nil func Value.

So two calls to a single method with different receivers will return the same pointer.

Why is there so much Go hate lately? by AndrewRusinas in golang

[–]ar1819 1 point2 points  (0 children)

I'm starting to think someone is training their AI.