Skip to content

Commit

Permalink
fix: only generate InitDefault when FrugalTag is on (#116)
Browse files Browse the repository at this point in the history
  • Loading branch information
felix021 authored Aug 11, 2023
1 parent 9868e28 commit 1412205
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions generator/golang/templates/slim/slim.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,13 @@ func New{{$TypeName}}() *{{$TypeName}} {
}
}
{{if Features.FrugalTag}}
func (p *{{$TypeName}}) InitDefault() {
*p = {{$TypeName}}{
{{template "StructLikeDefault" .}}
}
}
{{end}}{{/* if Features.FrugalTag */}}
{{template "FieldGetOrSet" .}}
Expand Down

0 comments on commit 1412205

Please sign in to comment.