Skip to content

cmd/go: does not verify existence of replace directory #28032

@komuw

Description

@komuw

Please answer these questions before submitting your issue. Thanks!

What version of Go are you using (go version)?

go version go1.11.1 linux/amd64

Does this issue reproduce with the latest release?

yes

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

GOARCH="amd64"
GOBIN=""
GOCACHE="/home/myname/.cache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/myname/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/go"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/myname/Downloads/test/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build816763754=/tmp/go-build -gno-record-gcc-switches"

What did you do?

create this go.mod file;

module aha

require (
	github.com/davecgh/go-spew v1.1.1 // indirect
	github.com/gin-contrib/sse v0.0.0-20170109093832-22d885f9ecc7 // indirect
	github.com/gin-gonic/gin v1.3.0 // indirect
	github.com/golang/protobuf v1.2.0 // indirect
	github.com/json-iterator/go v1.1.5 // indirect
	github.com/mattn/go-isatty v0.0.4 // indirect
	github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
	github.com/modern-go/reflect2 v1.0.1 // indirect
	github.com/pmezard/go-difflib v1.0.0 // indirect
	github.com/rs/cors v1.5.0
	github.com/stretchr/testify v1.2.2 // indirect
	github.com/ugorji/go/codec v0.0.0-20180927125128-99ea80c8b19a // indirect
	golang.org/x/net v0.0.0-20181005035420-146acd28ed58 // indirect
	golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f // indirect
	golang.org/x/sys v0.0.0-20181004145325-8469e314837c // indirect
	gopkg.in/go-playground/assert.v1 v1.2.1 // indirect
	gopkg.in/go-playground/validator.v8 v8.18.2 // indirect
	gopkg.in/yaml.v2 v2.2.1 // indirect
)

replace github.com/rs/cors/wrapper/gin => ../nonexistentDirectory/AntherDirectoryThatDoesNotExist

and this main.go file;

package main

import (
	"fmt"

	"github.com/rs/cors/wrapper/gin"
)

func main() {
	fmt.Println(gin.Options{})
}

then run;

go mod tidy && \
go mod verify && \
go run main.go

What did you expect to see?

a failure with a nice error message pointing out that the path ../nonexistentDirectory/AntherDirectoryThatDoesNotExist does not exist.

What did you see instead?

all modules verified
{[] <nil> [] [] [] 0 false false false}

Metadata

Metadata

Assignees

Labels

GoCommandcmd/goNeedsDecisionFeedback is required from experts, contributors, and/or the community before a change can be made.modules

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions