gonstructor

A command-line tool to generate a constructor for the struct.

BSD-3-CLAUSE License

Stars
84
Committers
8

Bot releases are visible (Hide)

gonstructor - v0.5.1 Latest Release

Published by github-actions[bot] 4 months ago

Fixes

  • fix Generation error on Go 1.22 #27 (@doilux)
  • fix: panic when generating in package with generics #26 (@jj-style)

Maintenance

  • Remove the typo " in the README file #24 (@ LintaoAmons)
  • Drop the unsupported go runtime versions #28 (@moznion)
  • Upgrade GitHub Actions actions #29 (@moznion)
gonstructor - v0.5.0

Published by github-actions[bot] almost 2 years ago

Enhancements

  • fix: multiple types import #21

Maintenance

  • Tweak for #21 #22
gonstructor - v0.4.2

Published by github-actions[bot] almost 2 years ago

Enhancements

  • Fix builder to use toLowerCamel for assignment parameter #20

Maintenance

  • c583c0b update deps
gonstructor - v0.4.1

Published by github-actions[bot] about 2 years ago

What's Changed

Bug fixes

  • Truncate and open a file when it open that file at the first time #18

Maintenance

  • Use golanglint-ci instead of golint #19
gonstructor - v0.4.0

Published by github-actions[bot] about 2 years ago

New Features

  • Accept the multiple --type options in order to output the generated code of the multiple types into a single file #14
  • Support -propagateInitFuncReturns CLI option #16

Maintenances

  • update go to 1.19, update deps, fix #9 #11

Documents

  • add note about goimports #7
gonstructor - v0.3.1

Published by github-actions[bot] over 3 years ago

New features

Add support for embedding #6

This pull-request makes this tool support embedded structure fields.

example:

type Embedded struct {
	Bar string
}

//go:generate gonstructor --type=StructureWithEmbedding --constructorTypes=allArgs,builder --withGetter
type StructureWithEmbedding struct {
	Embedded
	foo string
}

//go:generate gonstructor --type=StructureWithPointerEmbedding --constructorTypes=allArgs,builder --withGetter
type StructureWithPointerEmbedding struct {
	*Embedded
	foo string
}

Notes

Why v0.3.1?

v0.3.0 is reverted because that had broken.

Changelog

5bed476 Merge pull request #6 from moznion/embedding

gonstructor - v0.2.0

Published by kovetskiy over 4 years ago

Changelog

#4 avoid generating long lines

gonstructor - v0.1.0

Published by github-actions[bot] over 4 years ago

Changelog

  • Use own toLowerCamel for arguments since ID must be id not iD. #1 (@mattn++)
  • Add installation guide #2 (@Mushus++)
  • add -init parameter #3 (@kovetskiy++)
gonstructor - v0.0.1

Published by github-actions[bot] almost 5 years ago

Original release