Application generator
Generates a Go application under the given directory and registers it as an Nx project through the gonx inference plugin. Aliased as app.
nx g @naxodev/gonx:application <directory>
Options
Section titled “Options”| Option | Type | Default | Description |
|---|---|---|---|
directory | string | (required) | The directory of the new application. Accepted as the first positional argument. |
name | string | - | The name of the application. |
template | standard | cli | tui | standard | The template of application. |
tags | string | - | Add tags to the application (used for linting). |
skipFormat | boolean | false | Skip formatting files. |
- Runs the init generator first to register the inference plugin in
nx.json. - Creates a
go.modfor the project unless the template already includes one. Adds the project togo.workwhen a Go workspace is present. - Inferred targets for applications:
build,serve,test,lint,tidy,generate,nx-release-publish. Application detection requires amain.gocontainingpackage mainandfunc main(, or acmd/directory.