Did any #Go developers need code to get a zero value of a struct but without knowing the layout of the struct itself?
The only thing I could come up with was:
func zero[T any](v T) T {
 z := &v
 zz := reflect.ValueOf(z).Elem()
 zz.Set(reflect.Zero(reflect.TypeOf(v)))
 return *z
}
And see here an example of usage: https://go.dev/play/p/Aqzc_nRzOcP
I needed it in order to get zero copies of random structs so I could test that some marshal/unmarshal functionality is a bijection.
Is this a decent way to do it? Are there alternatives?
Go beyond Goroutines: introducing the Reactive paradigm
https://samuelberthe.substack.com/p/go-beyond-goroutines-introducing
#HackerNews #Go #Goroutines #ReactiveParadigm #Programming #Concurrency #SoftwareDevelopment
Write Go code in JavaScript files
The more I look at things written in #Rust, the more I want to write that on a daily basis.
I know the language and eco-system is far from perfect, I've been hurt too and maybe this is even stockholm syndrome speaking lol, but damn there is so many cool projects written in Rust.
I switched full time to #Go because of readability, but mostly for the same reason as I state above, lots of cool projects.
The more I look at things written in #Rust, the more I want to write that on a daily basis.
I know the language and eco-system is far from perfect, I've been hurt too and maybe this is even stockholm syndrome speaking lol, but damn there is so many cool projects written in Rust.
I switched full time to #Go because of readability, but mostly for the same reason as I state above, lots of cool projects.
On this topic, calling all #Go #developers interested in lending a hand.
I have two major goals for increasing the unit-test coverage in the individual packages that #GoActivityPub is comprised of.
These are tasks that are very accessible even for people new to the #ActivityPub spec and I would prefer to support new developers that want to give it a try than wait until I have time to do them myself.
The only requirement I have is that if you want to help, you already have some public Go projects that I can have a look at.
Point of contact is on this email (after you "deobfuscate" it): goap@federated·id
Well, after an initial failure, my #NLNet grant application for #GoActivityPub has been accepted under the NGI0 Commons Fund. 💪
This means that for the next months my main focus will be fully on making #ActivityPub in the #Go programming language easier for other developers.
If you're one of them, reach out, I want to know what you struggle with and how I can help with that.
On this topic, calling all #Go #developers interested in lending a hand.
I have two major goals for increasing the unit-test coverage in the individual packages that #GoActivityPub is comprised of.
These are tasks that are very accessible even for people new to the #ActivityPub spec and I would prefer to support new developers that want to give it a try than wait until I have time to do them myself.
The only requirement I have is that if you want to help, you already have some public Go projects that I can have a look at.
Point of contact is on this email (after you "deobfuscate" it): goap@federated·id
Yes, and I find it quite good.
And to run it as a #FastCGI, you don't even need a VPS: a cheap shared hosting supporting #CGI will run #snac2 just fine! https://encrypted.tesio.it/2024/12/18/how-to-run-your-own-social-network.html
That's why I prefer it to gotosocial.
Also I try to avoid #Go as much as possible cause it's a #Google's thing.
Snac is written in a pretty readable (and a bit clever, sometimes) #C.
And if you know C even a little bit, it's really worth a read.
@beachcomber@leecalvin.xyz @alephoto85@snac.bobadin.icu
@beachcomber both @alephoto85 and especially @giacomo have been using it for a long time.
Yes, and I find it quite good.
And to run it as a #FastCGI, you don't even need a VPS: a cheap shared hosting supporting #CGI will run #snac2 just fine! https://encrypted.tesio.it/2024/12/18/how-to-run-your-own-social-network.html
That's why I prefer it to gotosocial.
Also I try to avoid #Go as much as possible cause it's a #Google's thing.
Snac is written in a pretty readable (and a bit clever, sometimes) #C.
And if you know C even a little bit, it's really worth a read.
@beachcomber@leecalvin.xyz @alephoto85@snac.bobadin.icu
Olu
Olu is a JSON document store with automatic graph relationship tracking. When documents reference each other, the graph layer maintains edges automatically. RESTful API, dual storage backends, basic graph queries. Written in Go.
Core CRUD and graph operations work. About half the planned API is implemented. Still early but functional for prototyping.
Olu
Olu is a JSON document store with automatic graph relationship tracking. When documents reference each other, the graph layer maintains edges automatically. RESTful API, dual storage backends, basic graph queries. Written in Go.
Core CRUD and graph operations work. About half the planned API is implemented. Still early but functional for prototyping.
Well, after an initial failure, my #NLNet grant application for #GoActivityPub has been accepted under the NGI0 Commons Fund. 💪
This means that for the next months my main focus will be fully on making #ActivityPub in the #Go programming language easier for other developers.
If you're one of them, reach out, I want to know what you struggle with and how I can help with that.
Well, after an initial failure, my #NLNet grant application for #GoActivityPub has been accepted under the NGI0 Commons Fund. 💪
This means that for the next months my main focus will be fully on making #ActivityPub in the #Go programming language easier for other developers.
If you're one of them, reach out, I want to know what you struggle with and how I can help with that.
 
      
  
             
      
  
             
      
  
               
      
  
             
      
  
               
      
  
               
      
  
             
      
  
             
      
  
             
      
  
            