Fatal: could not read Username for 'https://github.com': terminal prompts disabled

Fatal: could not read Username for 'https://github.com': terminal prompts disabled
Photo by Praveen Thirumurugan / Unsplash

This happens when private modules are to be imported. The fix is:

export GOPRIVATE=github.com/mailio
export GIT_TERMINAL_PROMPT=1
go mod tidy