# Go: fatal: could not read Username for 'https://github.com': terminal prompts disabled

**Code:** `terminal prompts disabled / 410 Gone (private module)` · **Category:** Go · **Seen on:** Go, Git, Docker

Go tried to fetch a private repository without credentials (and, via the public proxy, got 404/410).

## Meaning

Tell Go the module is private with `GOPRIVATE`, and give git credentials non-interactively: a `~/.netrc`, a git `insteadOf` rewrite to SSH, or a token in CI. Without `GOPRIVATE` Go asks the public proxy, which cannot see your repo.

## Common causes

- GOPRIVATE not set
- No credentials for HTTPS git
- SSH key not available in CI/Docker
- Token expired
- Public proxy/sumdb queried for private paths

## Quick fix

1. `go env -w GOPRIVATE=github.com/yourorg/*`
2. `git config --global url."git@github.com:".insteadOf "https://github.com/"`
3. In CI use a token: `git config --global url."https://x:${TOKEN}@github.com/".insteadOf "https://github.com/"`

## Detailed fix by platform

### Docker

1. Use BuildKit secrets or SSH mounts (`RUN --mount=type=ssh go mod download`) instead of baking tokens into the image

## How to diagnose

1. **GOPRIVATE** — Set?
2. **Auth** — SSH or token?
3. **CI** — Secrets available?

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/go/private-module-terminal-prompts)
