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: 'go list' documentation missing Embed fields #43081

Closed
bcmills opened this issue Dec 8, 2020 · 3 comments
Closed

cmd/go: 'go list' documentation missing Embed fields #43081

bcmills opened this issue Dec 8, 2020 · 3 comments
Labels
Documentation FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done. release-blocker
Milestone

Comments

@bcmills
Copy link
Contributor

bcmills commented Dec 8, 2020

It appears that the output of go help list has not yet been updated to describe the new EmbedPatterns and EmbedFiles fields added for #41191. That documentation seems essential for authors of third-party tools that interact with the go command.

example.com$ go list -json .
{
        "Dir": "/tmp/tmp.LenZnJLHDJ/example.com",
        "ImportPath": "example.com",
        "Name": "main",
        "Target": "/tmp/tmp.LenZnJLHDJ/_gopath/bin/example.com",
        "Root": "/tmp/tmp.LenZnJLHDJ/example.com",
        "Module": {
                "Path": "example.com",
                "Main": true,
                "Dir": "/tmp/tmp.LenZnJLHDJ/example.com",
                "GoMod": "/tmp/tmp.LenZnJLHDJ/example.com/go.mod",
                "GoVersion": "1.16"
        },
        "Match": [
                "."
        ],
        "Stale": true,
        "StaleReason": "not installed but available in build cache",
        "GoFiles": [
                "main.go"
        ],
        "EmbedPatterns": [
                "main.go"
        ],
        "EmbedFiles": [
                "main.go"
        ],
        "Imports": [
                "embed",
                "fmt"
        ],
        "Deps": [
                "embed",
                "errors",
                "fmt",
                "internal/bytealg",
                "internal/cpu",
                "internal/fmtsort",
                "internal/oserror",
                "internal/poll",
                "internal/race",
                "internal/reflectlite",
                "internal/syscall/execenv",
                "internal/syscall/unix",
                "internal/testlog",
                "internal/unsafeheader",
                "io",
                "io/fs",
                "math",
                "math/bits",
                "os",
                "path",
                "reflect",
                "runtime",
                "runtime/internal/atomic",
                "runtime/internal/math",
                "runtime/internal/sys",
                "sort",
                "strconv",
                "strings",
                "sync",
                "sync/atomic",
                "syscall",
                "time",
                "unicode",
                "unicode/utf8",
                "unsafe"
        ]
}

example.com$ go help list | grep Embed

example.com$

-- go.mod --
module example.com

go 1.16
-- main.go --
package main

import (
	_ "embed"
	"fmt"
)

//go:embed main.go
var source string

func main() {
	fmt.Println(source)
}

CC @jayconrod @matloob @rsc

@bcmills bcmills added Documentation NeedsFix The path to resolution is known, but the work has not been done. release-blocker okay-after-beta1 Used by release team to mark a release-blocker issue as okay to resolve either before or after beta1 labels Dec 8, 2020
@bcmills bcmills added this to the Go1.16 milestone Dec 8, 2020
@toothrot toothrot removed the okay-after-beta1 Used by release team to mark a release-blocker issue as okay to resolve either before or after beta1 label Dec 17, 2020
@matloob matloob self-assigned this Jan 5, 2021
@gopherbot
Copy link

Change https://golang.org/cl/282195 mentions this issue: cmd/go: add documentation for Embed fields in go list output

@bcmills bcmills reopened this Jan 15, 2021
@bcmills
Copy link
Contributor Author

bcmills commented Jan 15, 2021

Looks like we missed the corresponding Test and XTest fields in the documentation.

In https://tip.golang.org/cmd/go/internal/load/#PackagePublic they're tucked away under the // Test information section, but they don't seem to be present at all in https://tip.golang.org/cmd/go/#hdr-List_packages_or_modules.

@gopherbot
Copy link

Change https://golang.org/cl/284258 mentions this issue: cmd/go: add documentation for test and xtest fields output by go list

@golang golang locked and limited conversation to collaborators Jan 22, 2022
@rsc rsc unassigned matloob Jun 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Documentation FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done. release-blocker
Projects
None yet
Development

No branches or pull requests

5 participants
@toothrot @bcmills @gopherbot @matloob and others