# GoAppResource

- Module: [Aspire.Hosting.Go](/reference/api/go/aspire.hosting.go.md)
- Version: `17.0.0`
- Kind: `handle`
- Source: [GitHub](https://github.com/microsoft/aspire/tree/bcfa151cdca6d0a573f22d5d9c23f9c727cb3b2f)

Represents a Go application resource in the distributed application model.

## Remarks

This resource allows Go applications to run as part of a distributed application. The resource
manages the Go toolchain, working directory, and lifecycle of the Go application.
Go applications can expose HTTP endpoints, communicate with other services, and participate
in service discovery like other Aspire resources. They support automatic OpenTelemetry
instrumentation when configured with the appropriate Go packages.

## Definition

```go
type GoAppResource interface {
    IComputeResource
    IContainerFilesDestinationResource
    Resource
    ResourceWithArgs
    ResourceWithEndpoints
    ResourceWithEnvironment
    ResourceWithWaitSupport
}
```

## Embeds

- `IComputeResource`
- `IContainerFilesDestinationResource`
- `Resource`
- `ResourceWithArgs`
- `ResourceWithEndpoints`
- `ResourceWithEnvironment`
- `ResourceWithWaitSupport`

## Properties

- `ResourceTypeDisplayName`: `string` `get` -- Gets the ResourceTypeDisplayName property

## Methods

- [WithAppArgs](/reference/api/go/aspire.hosting.go/goappresource/withappargs.md) -- `method` -- Passes extra arguments to the Go program at runtime. In normal run mode they appear after `go run .`; in Delve mode after the `--` separator.
  ```go
  WithAppArgs(args []any) GoAppResource
  ```
- [WithDelveServer](/reference/api/go/aspire.hosting.go/goappresource/withdelveserver.md) -- `method` -- 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.
  ```go
  WithDelveServer(options ...*DelveServerOptions) GoAppResource
  ```
- [WithGoPrivate](/reference/api/go/aspire.hosting.go/goappresource/withgoprivate.md) -- `method` -- Configures private Go module authentication for publish-time Dockerfile generation.
  ```go
  WithGoPrivate(privatePatterns []string, authHost string, options ...*WithGoPrivateOptions) GoAppResource
  ```
- [WithModDownload](/reference/api/go/aspire.hosting.go/goappresource/withmoddownload.md) -- `method` -- 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.
  ```go
  WithModDownload() GoAppResource
  ```
- [WithModTidy](/reference/api/go/aspire.hosting.go/goappresource/withmodtidy.md) -- `method` -- 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.
  ```go
  WithModTidy() GoAppResource
  ```
- [WithModVendor](/reference/api/go/aspire.hosting.go/goappresource/withmodvendor.md) -- `method` -- 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.
  ```go
  WithModVendor() GoAppResource
  ```
- [WithVetTool](/reference/api/go/aspire.hosting.go/goappresource/withvettool.md) -- `method` -- 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.
  ```go
  WithVetTool() GoAppResource
  ```
