# GoAppResource.withGoPrivate

- Module: [Aspire.Hosting.Go](/reference/api/typescript/aspire.hosting.go.md)
- Defined on: [GoAppResource](/reference/api/typescript/aspire.hosting.go/goappresource.md)
- Version: `13.4.0-preview.1.26281.18`
- Kind: `method`

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;
}
```

## Signature

```typescript
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`

## Defined on

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