Skip to content

x/pkgsite: package example skips critical package import #70630

@AndrewGMorgan

Description

@AndrewGMorgan

What is the URL of the page with the issue?

https://pkg.go.dev/kernel.org/pub/linux/libs/security/libcap/cap@v1.2.73#example-Set.Fill

What is your user agent?

Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36

Screenshot

image

What did you do?

I've been trying to include some package examples and this latest attempt is almost there...

The source for this file is: https://git.kernel.org/pub/scm/libs/libcap/libcap.git/tree/cap/cap_examples_test.go?id=6ef6a9d1e415c0b75e5acbcbcbfbda86d4ba6b91#n9

Which includes the header for the needed package. However, that package is omitted when the example renders.

What did you see happen?

The example is as hoped for minus the all important:

"kernel.org/pub/linux/libs/security/libcap/cap"

package reference.

What did you expect to see?

As provided in the example source, I expected this package to be listed in the example. If I manually put it there in the documented example on the website, and run that example, it generates the expected result.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions