# Aspire.Hosting.Go

- Module: `Aspire.Hosting.Go`
- Version: `17.0.0`
- Import path: `apphost/modules/aspire`
- Source: [GitHub](https://github.com/microsoft/aspire/tree/bcfa151cdca6d0a573f22d5d9c23f9c727cb3b2f)
- Functions: `8`
- Types: `2`

## Handles

- [GoAppResource](/reference/api/go/aspire.hosting.go/goappresource.md) -- `handle` - 8 members -- Represents a Go application resource in the distributed application model.

## DTOs

- [DelveServerOptions](/reference/api/go/aspire.hosting.go/delveserveroptions.md) -- `struct` - 6 fields -- Configures the headless Delve debug server used for remote debugging of a Go application.

## Functions

- [AddGoApp](/reference/api/go/aspire.hosting.go/addgoapp.md) -- `method` - on `DistributedApplicationBuilder` -- Adds a Go application to the application model. The Go toolchain must be available on the PATH.
- [WithAppArgs](/reference/api/go/aspire.hosting.go/withappargs.md) -- `method` - on `GoAppResource` -- Passes extra arguments to the Go program at runtime. In normal run mode they appear after `go run .`; in Delve mode after the `--` separator.
- [WithDelveServer](/reference/api/go/aspire.hosting.go/withdelveserver.md) -- `method` - on `GoAppResource` -- Starts a configurable headless Delve debug server so that DAP-compatible clients can attach remotely. The application is launched with `dlv debug` instead of `go run`. Delve must be available on the PATH.
- [WithGoPrivate](/reference/api/go/aspire.hosting.go/withgoprivate.md) -- `method` - on `GoAppResource` -- Configures private Go module authentication for publish-time Dockerfile generation.
- [WithModDownload](/reference/api/go/aspire.hosting.go/withmoddownload.md) -- `method` - on `GoAppResource` -- Runs `go mod download` before starting the application, pre-fetching all module dependencies into the local module cache without modifying `go.sum`. The main application waits for the download step to complete successfully before launching.
- [WithModTidy](/reference/api/go/aspire.hosting.go/withmodtidy.md) -- `method` - on `GoAppResource` -- Runs `go mod tidy` before starting the application, ensuring `go.sum` is up to date. The main application waits for the tidy step to complete successfully before launching.
- [WithModVendor](/reference/api/go/aspire.hosting.go/withmodvendor.md) -- `method` - on `GoAppResource` -- Runs `go mod vendor` before starting the application, caching all module dependencies in the local `vendor/` directory. The main application waits for the vendor step to complete successfully before launching.
- [WithVetTool](/reference/api/go/aspire.hosting.go/withvettool.md) -- `method` - on `GoAppResource` -- Runs `go vet ./...` before starting the application to catch static analysis issues. The main application waits for the vet step to complete successfully before launching.
