Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/go: go mod not using ~/.gitconfig settings #71482

Open
SOF3 opened this issue Jan 30, 2025 · 2 comments
Open

cmd/go: go mod not using ~/.gitconfig settings #71482

SOF3 opened this issue Jan 30, 2025 · 2 comments
Labels
WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.

Comments

@SOF3
Copy link

SOF3 commented Jan 30, 2025

Go version

go1.23 linux/amd64

Output of go env in your module/workspace:

GO111MODULE=''
GOARCH='arm64'
GOBIN=''
GOCACHE='/data/data/com.termux/files/home/.cache/go-build'
GOENV='/data/data/com.termux/files/home/.config/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='arm64'
GOHOSTOS='android'
GOINSECURE=''
GOMODCACHE='/data/data/com.termux/files/home/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='android'
GOPATH='/data/data/com.termux/files/home/go'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/data/data/com.termux/files/usr/lib/go'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/data/data/com.termux/files/usr/lib/go/pkg/tool/android_arm64'
GOVCS=''
GOVERSION='go1.23.5'
GODEBUG=''
GOTELEMETRY='local'
GOTELEMETRYDIR='/data/data/com.termux/files/home/.config/go/telemetry'
GCCGO='gccgo'
GOARM64='v8.0'
AR='ar'
CC='aarch64-linux-android-clang'
CXX='aarch64-linux-android-clang++'
CGO_ENABLED='1'
GOMOD='/data/data/com.termux/files/home/tmp/go.mod'
GOWORK=''
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
PKG_CONFIG='pkg-config'
GOGCCFLAGS='-fPIC -pthread -fno-caret-diagnostics -Qunused-arguments -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/data/data/com.termux/files/usr/tmp/go-build476618503=/tmp/go-build -gno-record-gcc-switches'

What did you do?

This is exactly the same as #65041 with thedifference that this issue concerns the global gitconfig ~/.gitconfig instead of the local .git/config, recreated as #65041 was closed due to the particular decision to ignore the local configuration.

I use a custom core.sshcommand configured at scope/origin global file:/root/.gitconfig, but Go (on docker run golang:1.23-alpine3.20, with apk add git 2.45.2) ignores the command I configured. I have to do GIT_SSH_COMMAND=$(git config core.sshcommand) go mod download to workaround this.

What did you see happen?

/module # go mod download 2>&1 | head -3
go: my.private/[email protected]: reading my.private/repo/go.mod at revision v1.2.3: git ls-remote -q origin in /go/pkg/mod/cache/vcs/xxxxxx: exit status 128:
        Host key verification failed.
        fatal: Could not read from remote repository.

/module # GIT_SSH_COMMAND=$(git config core.sshcommand) go mod download
(successful)

What did you expect to see?

The global gitconfig should be directly read by the Go command instead of separately configuring individual commands.

@seankhliao
Copy link
Member

please show a complete reproducer.

@seankhliao seankhliao added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Jan 30, 2025
@gabyhelp gabyhelp added the ToolProposal Issues describing a requested change to a Go tool or command-line program. label Jan 30, 2025
@seankhliao seankhliao removed the ToolProposal Issues describing a requested change to a Go tool or command-line program. label Jan 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

3 participants