# WithAppArgs

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

Passes extra arguments to the Go program at runtime. In normal run mode they appear after `go run .`; in Delve mode after the `--` separator.

## Definition

```go
func (GoAppResource) WithAppArgs(args []any) GoAppResource
```

## Parameters

- `args` (`[]any`) -- The program arguments (e.g., `"serve"`, `"--config"`, `"prod.yaml"`).

## Returns

[`GoAppResource`](/reference/api/go/aspire.hosting.go/goappresource.md) -- The resource builder.

Returns a handle; failures surface later via `Err()`.

## Applies to

- [`GoAppResource`](/reference/api/go/aspire.hosting.go/goappresource.md)
