|
75 | 75 | downloadUrl: 'https://github.com/moonrepo/moon/releases/latest/download' |
76 | 76 | ``` |
77 | 77 |
|
| 78 | +## Go |
| 79 | + |
| 80 | +## `unstable_go`<VersionLabel version="1.38.0" /> |
| 81 | + |
| 82 | +<HeadingApiLink to="/api/types/interface/ToolchainConfig#go" /> |
| 83 | + |
| 84 | +Enables and configures Go. This setting enables the new WASM powered Go toolchain. |
| 85 | + |
| 86 | +### `version` |
| 87 | + |
| 88 | +<HeadingApiLink to="/api/types/interface/GoConfig#version" /> |
| 89 | + |
| 90 | +Defines the explicit Go toolchain |
| 91 | +[version specification](../concepts/toolchain#version-specification) to use. If this field is _not |
| 92 | +defined_, the global `go` binary will be used. |
| 93 | + |
| 94 | +```yaml title=".moon/toolchain.yml" {2} |
| 95 | +unstable_go: |
| 96 | + version: '1.24.0' |
| 97 | +``` |
| 98 | + |
| 99 | +> Version can also be defined with [`.prototools`](../proto/config). |
| 100 | + |
| 101 | +### `bins` |
| 102 | + |
| 103 | +<HeadingApiLink to="/api/types/interface/GoConfig#bins" /> |
| 104 | + |
| 105 | +A list of binaries to install globally into Go (`~/go/bin`) using `go install`. This setting |
| 106 | +requires a list of URLs or binary configuration objects with the following fields: |
| 107 | + |
| 108 | +- `bin` (required) - URL of the binary. |
| 109 | +- `local` - Only install the binary locally, and not in CI. |
| 110 | + |
| 111 | +```yaml title=".moon/toolchain.yml" {2-5} |
| 112 | +unstable_go: |
| 113 | + bins: |
| 114 | + - 'golang.org/x/tools/gopls' |
| 115 | + - bin: 'github.com/revel/cmd/revel@1' |
| 116 | + local: true |
| 117 | +``` |
| 118 | + |
| 119 | +### `tidyOnChange` |
| 120 | + |
| 121 | +<HeadingApiLink to="/api/types/interface/GoConfig#tidyOnChange" /> |
| 122 | + |
| 123 | +Tidy modules when dependencies or `go.sum` changes by running `go mod tidy`. This setting is ignored |
| 124 | +when using Go workspaces. Defaults to `false`. |
| 125 | + |
| 126 | +```yaml title=".moon/toolchain.yml" {2} |
| 127 | +unstable_go: |
| 128 | + tidyOnChange: true |
| 129 | +``` |
| 130 | + |
| 131 | +### `vendorDir` |
| 132 | + |
| 133 | +<HeadingApiLink to="/api/types/interface/GoConfig#vendorDir" /> |
| 134 | + |
| 135 | +A relative path to the vendor directory from the dependencies root, as generated with |
| 136 | +`go mod vendor`. If vendored with the default name of "vendor", this setting can be omitted. |
| 137 | + |
| 138 | +```yaml title=".moon/toolchain.yml" {2} |
| 139 | +unstable_go: |
| 140 | + vendorDir: 'custom/vendor/path' |
| 141 | +``` |
| 142 | + |
| 143 | +### `workspaces` |
| 144 | + |
| 145 | +<HeadingApiLink to="/api/types/interface/GoConfig#workspaces" /> |
| 146 | + |
| 147 | +Enables support for [Go workspaces](https://go.dev/ref/mod#workspaces) and will attempt to locate |
| 148 | +the dependencies root by locating the `go.work` file, and parsing `go.work.sum` files. This |
| 149 | +functionality will take precedence over `go.sum` files. Defaults to `true`. |
| 150 | + |
| 151 | +```yaml title=".moon/toolchain.yml" {2} |
| 152 | +unstable_go: |
| 153 | + workspaces: true |
| 154 | +``` |
| 155 | + |
78 | 156 | ## JavaScript |
79 | 157 |
|
80 | 158 | ## `bun`<VersionLabel version="1.17.0" /> |
|
0 commit comments