#Interesting to see, just a small DX
1 messages · Page 1 of 1 (latest)
Do your WithToken and WithRunnerImage functions actually do anything significant? Or do they essentially just do:
func (o *YourObject) WithToken(token Secret) *YourObject {
o.Token = token
return o
}
Asking because I'm starting to wonder what it would be like if we autogenerated simple with* functions for modules and implemented them in the server itself to avoid an rpc (while still allowing users to override and write custom ones as needed). Would reduce boilerplate and improve performance, with the downside of encoding the with* pattern fairly deeply; have very mixed feelings about it right now.
Yes, they’re just dummy setters
I suppose this makes sense in that we essentially automatically create default getters for fields, so why not also create default setters?
I have some sense that we are recreating POJOs from Java here 😅
I felt that when we introduced Optional type 🤣