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: Retract field missing from 'go help mod edit' definition of the GoMod struct #43281

Closed
nomad-software opened this issue Dec 19, 2020 · 3 comments
Labels
Documentation FrozenDueToAge GoCommand cmd/go help wanted NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@nomad-software
Copy link

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

v1.16 beta1

Does this issue reproduce with the latest release?

Yes

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

go env Output
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/tmp/go-cache"
GOENV="/home/gary/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/tmp/go-mod-cache"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/media/Data/Projects/Go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/opt/go"
GOSUMDB="sum.golang.org"
GOTMPDIR="/tmp"
GOTOOLDIR="/opt/go/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.16beta1"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/media/Data/Projects/Go/src/github.com/nomad-software/vend/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-build3728920539=/tmp/go-build -gno-record-gcc-switches"

What did you do?

Issue the following command

go help mod edit

What did you expect to see?

Complete information regarding the new retract flag in regard to the json struct types.

What did you see instead?

...
type Module struct {
		Path string
		Version string
	}

	type GoMod struct {
		Module  Module
		Go      string
		Require []Require
		Exclude []Module
		Replace []Replace
	}

	type Require struct {
		Path string
		Version string
		Indirect bool
	}

	type Replace struct {
		Old Module
		New Module
	}

	type Retract struct {
		Low       string
		High      string
		Rationale string
	}
...

Notice that the GoMod definition is missing the Retract field.

@dmitshur dmitshur added this to the Go1.16 milestone Dec 21, 2020
@dmitshur dmitshur added the NeedsFix The path to resolution is known, but the work has not been done. label Dec 21, 2020
@dmitshur dmitshur changed the title go help mod edit documentation is not complete cmd/go: go help mod edit documentation is not complete Dec 21, 2020
@dmitshur dmitshur added the GoCommand cmd/go label Dec 21, 2020
@bcmills
Copy link
Contributor

bcmills commented Dec 21, 2020

What did you expect to see?

Complete information regarding the new retract flag in regard to the json struct types.

What, specifically, did you have in mind? The JSON struct definition is already there (https://tip.golang.org/cmd/go/#hdr-Edit_go_mod_from_tools_or_scripts):

The -retract=version and -dropretract=version flags add and drop a retraction on the given version. The version may be a single version like "v1.2.3" or a closed interval like "[v1.1.0,v1.1.9]". Note that -retract=version is a no-op if that retraction already exists.

type Retract struct {
	Low       string
	High      string
	Rationale string
}

Retract entries representing a single version (not an interval) will have the "Low" and "High" fields set to the same value.

CC @jayconrod @matloob

@bcmills bcmills added NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. labels Dec 21, 2020
@gopherbot gopherbot removed the NeedsFix The path to resolution is known, but the work has not been done. label Dec 21, 2020
@nomad-software
Copy link
Author

What, specifically, did you have in mind?

The documentation needs to add the Retract field to the GoMod struct, like this:

	type GoMod struct {
		Module  Module
		Go      string
		Require []Require
		Exclude []Module
		Replace []Replace
		Retract []Retract
	}

@bcmills bcmills added the NeedsFix The path to resolution is known, but the work has not been done. label Dec 22, 2020
@gopherbot gopherbot removed the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Dec 22, 2020
@bcmills bcmills changed the title cmd/go: go help mod edit documentation is not complete cmd/go: Retract field missing from 'go help mod edit' definition of the GoMod struct Dec 22, 2020
@bcmills bcmills added help wanted and removed WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. labels Dec 22, 2020
@gopherbot
Copy link

Change https://golang.org/cl/279592 mentions this issue: cmd/go: add the Retract field to 'go help mod edit' definition of the GoMod struct

@golang golang locked and limited conversation to collaborators Dec 23, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Documentation FrozenDueToAge GoCommand cmd/go help wanted NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants