News for hackers. Stuff that matters.
Re:Should Go 2.0 support generics? by GauntletWizard on Sunday July 23, 2017 @03:07AM (#14831201)
Go already allows you to rename imports. It's already used in the example provided, actually; the first token is the aliased name of the package.

I.e.

  import intlist "container/list" {Value: int}
  import stringlist "container/list" {Value: string}
Re:Should Go 2.0 support generics? by Someone on Sunday July 23, 2017 @11:34AM (#14832709)
Thanks. I didn't realize that the second token was a user-specified name.

So, this basically would boil down to something like C++ templates, with he extra requirement that templates must be instantiated explicitly.