Library generator
Generates a Go library under the given directory and registers it as an Nx project through the gonx inference plugin. Aliased as lib.
nx g @naxodev/gonx:library <directory>
Options
Section titled “Options”| Option | Type | Default | Description |
|---|---|---|---|
directory | string | (required) | The directory of the new library. Accepted as the first positional argument. |
name | string | - | The name of the library. |
tags | string | - | Add tags to the library (used for linting). |
skipFormat | boolean | false | Skip formatting files. |
- Runs the init generator first to register the inference plugin in
nx.json. - Always creates a
go.modfor the project. Adds the project togo.workwhen a Go workspace is present. - Inferred targets for libraries:
test,lint,tidy,generate,nx-release-publish. Libraries do not inferbuildorserve.