# Go (/pipeline-sdk/reference/toolchains/go)



{/* Generated by docs-site/scripts/generate-dsl-docs.ts — do not edit. */}

## `go` [#go]

Callable singleton for the Go toolchain — access as `hm.go`.

Call directly to construct a `GoToolchain`, or use the bare-form
action methods (`go.build()`, `go.test()`, etc.) for a one-shot leaf.

```python
go(*, path='.', version='1.23.2', image=None, base=None) -> GoToolchain
```

| Parameter                                | Type           | Default    | Description                                              |
| ---------------------------------------- | -------------- | ---------- | -------------------------------------------------------- |
| `path`                                   | `str`          | `'.'`      | Path to the Go module root.                              |
| `version`                                | `str`          | `'1.23.2'` | Go version to install (e.g. `"1.23.2"`). Must be a       |
| full `MAJOR.MINOR.PATCH` version string. |                |            |                                                          |
| `image`                                  | `str \| None`  | `None`     | Local-mode Docker base image override.                   |
| `base`                                   | `Step \| None` | `None`     | Existing `Step` to attach to instead of emitting a fresh |
| apt-base step.                           |                |            |                                                          |

**Returns** `GoToolchain` — A `GoToolchain` ready for action methods.

### `go.build()` [#gobuild]

```python
build(**kw) -> Step
```

| Parameter | Type  | Default | Description |
| --------- | ----- | ------- | ----------- |
| `kw`      | `Any` | `{}`    | —           |

**Returns** `Step`

### `go.fmt()` [#gofmt]

```python
fmt(**kw) -> Step
```

| Parameter | Type  | Default | Description |
| --------- | ----- | ------- | ----------- |
| `kw`      | `Any` | `{}`    | —           |

**Returns** `Step`

### `go.test()` [#gotest]

```python
test(**kw) -> Step
```

| Parameter | Type  | Default | Description |
| --------- | ----- | ------- | ----------- |
| `kw`      | `Any` | `{}`    | —           |

**Returns** `Step`

### `go.vet()` [#govet]

```python
vet(**kw) -> Step
```

| Parameter | Type  | Default | Description |
| --------- | ----- | ------- | ----------- |
| `kw`      | `Any` | `{}`    | —           |

**Returns** `Step`

## `GoEntry` [#goentry]

Callable singleton for the Go toolchain — access as `hm.go`.

Call directly to construct a `GoToolchain`, or use the bare-form
action methods (`go.build()`, `go.test()`, etc.) for a one-shot leaf.

### `GoEntry.build()` [#goentrybuild]

```python
build(**kw) -> Step
```

| Parameter | Type  | Default | Description |
| --------- | ----- | ------- | ----------- |
| `kw`      | `Any` | `{}`    | —           |

**Returns** `Step`

### `GoEntry.fmt()` [#goentryfmt]

```python
fmt(**kw) -> Step
```

| Parameter | Type  | Default | Description |
| --------- | ----- | ------- | ----------- |
| `kw`      | `Any` | `{}`    | —           |

**Returns** `Step`

### `GoEntry.test()` [#goentrytest]

```python
test(**kw) -> Step
```

| Parameter | Type  | Default | Description |
| --------- | ----- | ------- | ----------- |
| `kw`      | `Any` | `{}`    | —           |

**Returns** `Step`

### `GoEntry.vet()` [#goentryvet]

```python
vet(**kw) -> Step
```

| Parameter | Type  | Default | Description |
| --------- | ----- | ------- | ----------- |
| `kw`      | `Any` | `{}`    | —           |

**Returns** `Step`

## `GoToolchain` [#gotoolchain]

Go toolchain install chain — constructed via `hm.go()`.

Holds the go-install step. Action methods (`build`, `test`, `vet`,
`fmt`) attach leaves to `installed`.

### Fields [#fields]

| Field       | Type   | Default    |
| ----------- | ------ | ---------- |
| `path`      | `str`  | *required* |
| `installed` | `Step` | *required* |

### `GoToolchain.build()` [#gotoolchainbuild]

```python
build(**kw) -> Step
```

| Parameter | Type  | Default | Description |
| --------- | ----- | ------- | ----------- |
| `kw`      | `Any` | `{}`    | —           |

**Returns** `Step`

### `GoToolchain.fmt()` [#gotoolchainfmt]

```python
fmt(**kw) -> Step
```

| Parameter | Type  | Default | Description |
| --------- | ----- | ------- | ----------- |
| `kw`      | `Any` | `{}`    | —           |

**Returns** `Step`

### `GoToolchain.test()` [#gotoolchaintest]

```python
test(**kw) -> Step
```

| Parameter | Type  | Default | Description |
| --------- | ----- | ------- | ----------- |
| `kw`      | `Any` | `{}`    | —           |

**Returns** `Step`

### `GoToolchain.vet()` [#gotoolchainvet]

```python
vet(**kw) -> Step
```

| Parameter | Type  | Default | Description |
| --------- | ----- | ------- | ----------- |
| `kw`      | `Any` | `{}`    | —           |

**Returns** `Step`
