golang / go

The Go programming language
https://go.dev
BSD 3-Clause "New" or "Revised" License
124.37k stars 17.71k forks source link

Cannot Install Go Programs that use Replace Directives #64921

Closed clseibold closed 11 months ago

clseibold commented 11 months ago

Go version

go version go1.21.0 windows/amd64

What operating system and processor architecture are you using (go env)?

set GO111MODULE=
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\krixa\AppData\Local\go-build
set GOENV=C:\Users\krixa\AppData\Roaming\go\env
set GOEXE=.exe
set GOEXPERIMENT=
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOINSECURE=
set GOMODCACHE=C:\Users\krixa\go\pkg\mod
set GONOPROXY=
set GONOSUMDB=
set GOOS=windows
set GOPATH=C:\Users\krixa\go
set GOPRIVATE=
set GOPROXY=https://proxy.golang.org,direct
set GOROOT=C:\Program Files\Go
set GOSUMDB=sum.golang.org
set GOTMPDIR=
set GOTOOLCHAIN=auto
set GOTOOLDIR=C:\Program Files\Go\pkg\tool\windows_amd64
set GOVCS=
set GOVERSION=go1.21.0
set GCCGO=gccgo
set GOAMD64=v1
set AR=ar
set CC=gcc
set CXX=g++
set CGO_ENABLED=0
set GOMOD=C:\Users\krixa\Dev\misfin-server\go.mod
set GOWORK=
set CGO_CFLAGS=-O2 -g
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-O2 -g
set CGO_FFLAGS=-O2 -g
set CGO_LDFLAGS=-O2 -g
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -fno-caret-diagnostics -Qunused-arguments -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=C:\Users\krixa\AppData\Local\Temp\go-build301712887=/tmp/go-build -gno-record-gcc-switches

What did you do?

go install gitlab.com/clseibold/misfinmail/v2@4eb9fba57e4d26d79e0ef6460b2e85084269087b

What did you expect to see?

It should install the damn program, using the well-defined replace directive in the go mod file. It makes absolutely no sense to assume that replace directives are for developer debug runs only.

What did you see instead?

A limitation that is the result of terrible golang developers that keep making terrible decisions, even though everyone told them how terrible it was in this very issue: https://github.com/golang/go/issues/44840

seankhliao commented 11 months ago

working as intended