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 | Directory of the new library. Taken from the first positional argument. |
| name | string | - | Name of the library. Must match ^[a-zA-Z][^:]*$. |
| tags | string | - | Tags to add 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.