It could even just be a prompt at first use, if an environment variable (eg. GO_DISABLE_TELEMETRY=1) is not detected. Example:
Do you want to enable anonymous telemetry? yes [no]
Your choice will be remembered and we won't ask you again.
See our engagements and details on what we collect here: https://go.dev/telemetry
In any good development org, yes. But I'm sure there are orgs out there where the team that manages the environment and the team that does Go builds are two separate teams.
Now the team managing CI (or QA which could actually be in a TTY) needs to notice these failures and communicate them (via a JIRA ticket of course) back to the development team. That team doesn't know what it's about and sticks it on the backlog. Eventually they give the right environment variable, but environment variables are a security risk so it needs to go through security review, and because this mentions telemetry data the privacy and legal teams want sign-off...
This might be an exaggeration, but I think it's worth thinking about the worst case scenario when building things like this into development tools that are used so widely.
Hey, if it can help highlight dysfunctional Kafkaesque processes in companies, that's a bonus.
If you can't update an environment variable yourself, or ask directly someone who can, all that on a CI system that's somehow bound to TTY, get out of here.