# withGoPrivate

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

Configures private Go module authentication for publish-time Dockerfile generation.

## Definition

```typescript
interface GoAppResource {
  // ... omitted for brevity
  withGoPrivate(
    privatePatterns: string[],
    authHost: string,
    usernameArgName?: string,
    tokenSecretId?: string): GoAppResource
}
```

## Parameters

- `privatePatterns` (`string[]`)
- `authHost` (`string`)
- `usernameArgName` (`string`) `optional` `= GIT_USER`
- `tokenSecretId` (`string`) `optional` `= gittoken`

## Returns

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

## Applies to

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