Skip to content

cmd/go: go1.16 default go build behavior changes seem detrimental to developer flow #44212

Closed
@andrewstuart

Description

@andrewstuart

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

$ go version
go version go1.16rc1 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
GO111MODULE="on"
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GONOPROXY="*"
GONOSUMDB="*"
GOOS="linux"
GOPRIVATE="*"
GOPROXY="direct"
GOSUMDB="off"
GOTMPDIR=""
GOVCS=""
GOVERSION="go1.16rc1"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
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-build4000834506=/tmp/go-build -gno-record-gcc-switches"

What did you do?

Tried to build a package in a development cycle from within vim while adding dependencies the way I have for 6+ years.

What did you expect to see?

Compiler errors relating to the code in my repository.

What did you see instead?

go build errors out telling me that a package is not provided by anything in go.mod and that I need to add it with go get

After running go get to add the package, I attempt another build and am met with another error telling me that there is a "missing go.sum entry for module providing package ... imported by ..." and prints out helpful commands, but does not keep me in the flow of development as Go has historically been great at by default.

I understand the reasons behind the desire to not constantly change go.mod and go.sum invisibly to the user, but I think it's worth rethinking this default behavior as it seems very much contrary to the ethos of go tooling up to this point. I've always appreciated when things just work while also trying to help me keep myself safe.

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeGoCommandcmd/goNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.WaitingForInfoIssue is not actionable because of missing required information, which needs to be provided.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions