Skip to content

x/pkgsite: deprecated vars and consts are not rendered as deprecated #80803

Open

Description

@thaJeztah

While previewing docs for a change I was working on, I noticed that deprecated vars and consts are not rendered as deprecated.

Given the following module;

package deprecated

// DeprecatedVariable is not used.
//
// Deprecated: no longer used.
var DeprecatedVariable = "unused"

// DeprecatedConst is not used.
//
// Deprecated: no longer used.
const DeprecatedConst = "unused"

// DeprecatedFunc is not used.
//
// Deprecated: no longer used.
func DeprecatedFunc(){}

Rendering the documentation does not decorate the DeprecatedVariable and DeprecatedConst as deprecated;

go mod init example.com/deprecated

cat > main.go <<-'EOF'
package deprecated

// DeprecatedVariable is not used.
//
// Deprecated: no longer used.
var DeprecatedVariable = "unused"

// DeprecatedConst is not used.
//
// Deprecated: no longer used.
const DeprecatedConst = "unused"

// DeprecatedFunc is not used.
//
// Deprecated: no longer used.
func DeprecatedFunc(){}
EOF

go install golang.org/x/pkgsite/cmd/pkgsite@latest
go: downloading golang.org/x/pkgsite v0.3.0

pkgsite -open -http=:6060 .

Example output;

Image

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions