News for hackers. Stuff that matters.
Re:Writing secure Go code by imiric on Monday November 04, 2024 @03:39PM (#42045779)
Indeed. I still try to avoid generics whenever possible, and prefer a solution that doesn't use them. Thankfully, there aren't many scenarios where they're absolutely indispensable.
Re:Writing secure Go code by kubb on Monday November 04, 2024 @03:46PM (#42045820)
Write a generic instantiator that scans your codebase for generic usage, and makes one copy of a generic for every type it's used with. Then you can remove all the generics and go back to copy and paste.