Skip to content

v1.7.0

Latest
Compare
Choose a tag to compare
@moznion moznion released this 22 Aug 08:15
2511448

What's changed

New Features

Expands the generics code generation #16

This library has already supported the generics syntax on only struct declaration.
This version expands the supported generics syntaxes/notations like the following:

  • generic types on function invocation like foo[int64](123)
  • generic parameter names on function receiver like func (s MyStruct[T])
  • generic parameter names on function return values like func foo[T struct]() MyStruct[T]
  • generic type parameters on interface declaration like type MyInterface[T any] interface {}

This patch also introduces TypeParameterNames which is an alias of []string to represent the generic parameter names, e.g. T.

And this patch makes it supports the generics union types.

Maintenance

  • Upgrade the go runtime to 1.19 #15
  • Use golangci-lint instead of golint and staticcheck #14
  • Adjust the type usage of TypeParameters #13