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/internal/modget: stdout does not end in new line #44951

Closed
carnott-snap opened this issue Mar 11, 2021 · 3 comments
Closed

cmd/go/internal/modget: stdout does not end in new line #44951

carnott-snap opened this issue Mar 11, 2021 · 3 comments

Comments

@carnott-snap
Copy link

carnott-snap commented Mar 11, 2021

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

[user@localhost ~]$ go version
go version go1.16 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
[user@localhost ~]$ go env
GO111MODULE="on"
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/user/.cache/go-build"
GOENV="/home/user/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GONOPROXY="*.sc-corp.net"
GONOSUMDB="*.sc-corp.net"
GOOS="linux"
GOPATH="/home/user/go"
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/home/user/.local/share/umake/go/go-lang"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/home/user/.local/share/umake/go/go-lang/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/tmp/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-build698062687=/tmp/go-build -gno-record-gcc-switches"

What did you do?

Create the following go.mod file:

module test
  
go 1.16

require k8s.io/client-go v12.0.0+incompatible

Create the following main.go file:

package main
  
import (
        "fmt"

        "k8s.io/client-go/pkg/version"
)

func main() { fmt.Println(version.Get()) }
go mod download: k8s.io/client-go@v12.0.0+incompatible: invalid version: +incompatible suffix not allowed: module contains a go.mod file, so semantic import versioning is required
[user@localhost trash]$ go get k8s.io/client-go@v12.0.0
go get: k8s.io/client-go@v12.0.0: invalid version: module contains a go.mod file, so major version must be compatible: should be v0 or v1, not v12
[user@localhost trash]$ go run .
main.go:6:2: missing go.sum entry for module providing package k8s.io/client-go/pkg/version (imported by test); to add:
        go get test
[user@localhost trash]$ go get test

What did you expect to see?

go: warning: k8s.io/client-go@v12.0.0+incompatible: retracted by module author: pre-module versions are obsolete
go: to switch to the latest unretracted version, run:
        go get k8s.io/client-go@latest
[user@localhost trash]$ 

What did you see instead?

The go get is ending the printed string without a newline:

go: warning: k8s.io/client-go@v12.0.0+incompatible: retracted by module author: pre-module versions are obsolete
go: to switch to the latest unretracted version, run:
        go get k8s.io/client-go@latest[user@localhost trash]$ 
@bcmills
Copy link
Contributor

bcmills commented Mar 11, 2021

Duplicate of #44674

@bcmills bcmills marked this as a duplicate of #44674 Mar 11, 2021
@bcmills bcmills closed this as completed Mar 11, 2021
@bcmills
Copy link
Contributor

bcmills commented Mar 11, 2021

(This should be fixed in 1.16.2: #44676)

@carnott-snap
Copy link
Author

yeah, just found the fix as I was in the process of making a cl

@carnott-snap carnott-snap changed the title cmd/go/internal/get: stdout does not end in new line cmd/go/internal/modget: stdout does not end in new line Mar 11, 2021
@golang golang locked and limited conversation to collaborators Mar 11, 2022
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