# GoAppResource

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

Represents a Go application resource in the distributed application model.

## Definition

```typescript
interface GoAppResource
  extends IComputeResource,
    IContainerFilesDestinationResource,
    IResource,
    IResourceWithArgs,
    IResourceWithEndpoints,
    IResourceWithEnvironment,
    IResourceWithProbes,
    IResourceWithWaitSupport,
    IResourceWithServiceDiscovery {
  withAppArgs(args: any[]): GoAppResource;
  withDelveServer(port?: number): GoAppResource;
  withGoPrivate(
      privatePatterns: string[],
      authHost: string,
      usernameArgName?: string,
      tokenSecretId?: string): GoAppResource;
  withModDownload(): GoAppResource;
  withModTidy(): GoAppResource;
  withModVendor(): GoAppResource;
  withVetTool(): GoAppResource;
}
```

## Methods

- [withAppArgs](/reference/api/typescript/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.
    ```typescript
  withAppArgs(args: any[]): GoAppResource
  ```
- [withDelveServer](/reference/api/typescript/aspire.hosting.go/goappresource/withdelveserver.md) -- `method` -- Starts a headless Delve debug server so that any DAP-compatible client can attach remotely. The application is launched as `dlv --headless=true --listen=127.0.0.1:<port> --api-version=2 debug .` instead of `go run .`. Delve must be available on the PATH.
    ```typescript
  withDelveServer(port?: number): GoAppResource
  ```
- [withGoPrivate](/reference/api/typescript/aspire.hosting.go/goappresource/withgoprivate.md) -- `method` -- Configures private Go module authentication for publish-time Dockerfile generation.
    ```typescript
  withGoPrivate(privatePatterns: string[], authHost: string, usernameArgName?: string, tokenSecretId?: string): GoAppResource
  ```
- [withModDownload](/reference/api/typescript/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.
    ```typescript
  withModDownload(): GoAppResource
  ```
- [withModTidy](/reference/api/typescript/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.
    ```typescript
  withModTidy(): GoAppResource
  ```
- [withModVendor](/reference/api/typescript/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.
    ```typescript
  withModVendor(): GoAppResource
  ```
- [withVetTool](/reference/api/typescript/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.
    ```typescript
  withVetTool(): GoAppResource
  ```
