Releases: moznion/gowrtr
Releases · moznion/gowrtr
v1.7.0
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
v1.6.0
v1.5.1
Bugfix
07420ca: Fix STDIN/STDOUT buffer issue on code generation with code formatters
There was a problem that it cannot generate code if the input size (i.e. raw generated code) is too big, because of the buffer of the OS.
This commit fixes that problem by using exec.Cmd#StdinPipe()
and removes some redundant/unsophisticated code.
As far as I checked, this problem appeared on only Linux.
v1.5.0
v1.4.1
v1.4.0
v1.3.0
v1.2.0
v1.1.0
Breaking Changes
struct fields of each generator to be private
Change method interfaces
AnonymousFunc
SetFuncInvocation()
->Invocation()
AnonymousFuncSignature
AddFuncParameters()
->AddParameters()
FuncSignature
AddFuncParameters()
->AddParameters()
If
AddElseIfBlocks()
->AddElseIf()
SetElseBlock()
->Else()
Interface
AddFuncSignatures()
->AddSignatures()
Root
EnableGofmt()
->Gofmt()
EnableGoimports()
->Goimports()
Switch
AddCaseStatements()
->AddCase()
SetDefaultStatement()
->Default()
Changes
Add setter methods
AnonymousFunc
Statements()
AnonymousFuncSignature
Parameters()
ReturnTypes()
Case
Statements()
CodeBlock
Statements()
DefaultCase
Statements()
Else
Statements()
ElseIf
Statements()
For
Statements()
Func
Statements()
FuncInvocation
Parameters()
FuncSignature
Parameters()
ReturnTypes()
If
Statements()
ElseIf()
Import
Imports()
Interface
Signatures()
ReturnStatement
ReturnItems()
Root
Statements()
Case()