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

Releases: kevinconway/wrapgen

Update x/tools to support Go 1.22

16 Feb 17:27
529bf1a
Compare
Choose a tag to compare

Installing and running the tool with Go 1.22 resulted in a panic from the x/tools library. The library is updated in go.mod to a recent version which resolves the panic.

Add ImportsWithSource template value

03 Apr 15:22
c41ef5e
Compare
Choose a tag to compare

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.

Fix source package name detection

04 Oct 03:27
68efbce
Compare
Choose a tag to compare

The previous version assumed that the package path ended with the
package name. In cases where the package path contained invalid package
characters, like "-", the tools would generate invalid output.

The naive solution to this would be to use the --package flag to set
the name to something valid. However, this flag indicates that the
source and destination packages are different. This results in the
source package receiving an import alias to prevent conflicts. This
means that any package generated using --package that is rendered
within the file tree of --source also results in an invalid file.

This patch preserves all existing behaviors except that it now correctly
extracts the true package name rather than relying on the package path.

Delay output file creation until the end

04 Oct 02:33
55893d7
Compare
Choose a tag to compare

This resolves an issue that appears when generating an output file into
the same package from which the interfaces are being loaded. The empty
file causes the Go package to become invalid which prevents the tool
from parsing the code.

Add optional destination file

04 Oct 02:23
070a0bb
Compare
Choose a tag to compare

Defaulting to STDOUT is useful for creating script pipelines but it is
difficult to use with go:generate. There is no way to pipe and redirect
STDOUT in the go:generate comment syntax without breaking the
abstraction and adding something like sh -c "<command>".

This new option preserves backwards compatibility by keeping STDOUT the
default output but offers a new option of specifying --destination
which switches the output to a specified file.

Fix go modules compatibility for v2+ releases

28 Sep 16:59
40267f2
Compare
Choose a tag to compare
Merge pull request #10 from kevinconway/fix-v2-modules

Add /v2 path to module

Fix issues related to conflicting package names

24 Sep 22:12
70893f2
Compare
Choose a tag to compare
Merge pull request #9 from orian/fix-pkg-name-conflicts

Added proper handling of package name conflict.

Go modules support

28 May 02:04
6a54583
Compare
Choose a tag to compare

Add support for go modules.
Switch to go modules for dependency management.
Add ability to render select interfaces.
More heavily annotate the AST related code and add new cases.
Add support for rendering in and out of the source package.
Drop code API.

Legacy release

28 May 01:42
Compare
Choose a tag to compare

I never made a release of the stable version of this package. Creating one before major changes are introduced.