Application Generator
nx g @naxodev/gonx:application my-go-app
Options
Section titled “Options”Option | Type | Default | Description |
---|---|---|---|
name | string | null | Name of the Go application |
directory | string | *required | The directory of the new application |
tags | string | null | Add tags to the application (used for linting) |
skipFormat | boolean | false | Skip formatting files |
Examples
Section titled “Examples”Generate an application in the root
Section titled “Generate an application in the root”nx g @naxodev/gonx:application my-go-app
Generate an application in a specific directory
Section titled “Generate an application in a specific directory”nx g @naxodev/gonx:application apps/my-go-app
or
nx g @naxodev/gonx:application --name=go-app --directory=apps/my-go-app
Generate an application with tags
Section titled “Generate an application with tags”[!NOTE] Tags will only work when the project was created with a project.json file
nx g @naxodev/gonx:application my-go-app --tags="json yaml"
Output
Section titled “Output”The generator creates a Go application with the following structure:
my-go-app/ ── main.go├── go.mod├── go.sum
- Unlike the original nx-go, gonx does not generate a project.json file
- Uses inferred tasks, so you can immediately use
nx build
,nx serve
, etc.