Skip to content
This repository was archived by the owner on Jun 22, 2024. It is now read-only.

Add ImportsWithSource template value

Compare
Choose a tag to compare
@kevinconway kevinconway released this 03 Apr 15:22
· 3 commits to master since this release
c41ef5e

Add a template value called ImportsWithSource. This is equivalent to the Imports value injected into templates but is guaranteed to contain the Source value. This is useful in cases when generating code with a --package set to a different value than Source because Imports is only generated from the import statements in Source which never contains itself. The documented suggestion of using goimports should continue to resolve this condition for users of the Imports template value which makes this change backwards compatible. You are encouraged to use ImportsWithSource if you want to use the --package flag without needing to also run goimports.

Additionally, the Imports and ImportsWithSource values are now deduped which removes another reliance on goimports.