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

Warn when v2 or other directory appears in source dir #33186

Closed
vyskocilm opened this issue Jul 19, 2019 · 1 comment
Closed

Warn when v2 or other directory appears in source dir #33186

vyskocilm opened this issue Jul 19, 2019 · 1 comment

Comments

@vyskocilm
Copy link

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

$ go version
go version go1.12.1 linux/amd64

Does this issue reproduce with the latest release?

Yes!

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

go env Output
$ go env
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/mvyskocil/.cache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/mvyskocil/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/mvyskocil/projects/cnc/behav/playground/BEH-432-rpc-mod/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-build697224910=/tmp/go-build -gno-record-gcc-switches"

What did you do?

Author of github.com/gorilla/rpc placed v2 of it's library to v2 directory. As he was apparently not using go modules, this was perfectly valid move. Which unfortunately ends in a situation gorilla/rpc/v2 is illegal for use with go modules. And fixing the problem breaks backward compatibility for non module users.

What did you expect to see?

go build or go vet should issue a warning in this case. Especially if such directory contains go source files. That way the well known compatibility problem will be reported for developers unaware about Go modules.

Reference: gorilla/rpc#65

@bcmills
Copy link
Contributor

bcmills commented Jul 22, 2019

A v2 directory is not a problem in general, even with modules: it should work fine, and we should not warn about it.

I do see a bug in relation to github.com/gorilla/rpc/v2, but it's #33099, and that's fixed at head. (I added more detail on gorilla/rpc#65.)

@bcmills bcmills closed this as completed Jul 22, 2019
@golang golang locked and limited conversation to collaborators Jul 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants