News for hackers. Stuff that matters.
Re:Fixing for Loops in Go 1.22 by wazzaps on Tuesday September 19, 2023 @05:56PM (#37577417)
Copying a mutex by value (thus duplicating the lock, causing deadlocks or worse) is far too easy
Re:Fixing for Loops in Go 1.22 by usefulcat on Tuesday September 19, 2023 @06:17PM (#37577718)
Wow, even c++ won't let you do that (without invoking undefined behavior, anyway).
Re:Fixing for Loops in Go 1.22 by icholy on Tuesday September 19, 2023 @05:57PM (#37577447)
`go vet` catches this.
Re:Fixing for Loops in Go 1.22 by erik_seaberg on Tuesday September 19, 2023 @06:42PM (#37578048)
Is there a way to declare any type uncopyable? This is something I always thought Ada got right.
Re:Fixing for Loops in Go 1.22 by smasher164 on Tuesday September 19, 2023 @06:54PM (#37578188)
you stick this in your struct

    type noCopy struct{}
    func (*noCopy) Lock()   {}
    func (*noCopy) Unlock() {}
Re:Fixing for Loops in Go 1.22 by mhh__ on Tuesday September 19, 2023 @06:52PM (#37578170)
I use a tool called "type theory"
Re:Fixing for Loops in Go 1.22 by icholy on Tuesday September 19, 2023 @07:11PM (#37578352)
Keep posting about D, I'm sure it will catch on soon.