Skip to content

cmd/doc: Blank lines inserted into doc output in place of "directive" lines  #59529

Description

@thockin

xref #56592

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

$ gotip version
go version devel go1.21-f00c54146c Mon Apr 10 22:52:22 2023 +0000 linux/amd64

Does this issue reproduce with the latest release?

This tests a change made on tip.

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

NA

What did you do?

Given this file:

// Package p is a package.
//
//magic:true
package p

// T is a type
//
//magic:true
type T struct {
	// Field is a field
	//magic:true
	Field int
}

go 1.20 go doc shows:

$ go doc --all .
package p // import "hockin.org/p"

Package p is a package.

TYPES

type T struct {
	// Field is a field
	//magic:true
	Field int
}
    T is a type

Note the directive line is present. gotip doc says:

$ gotip doc --all .
package p // import "hockin.org/p"

Package p is a package.

TYPES

type T struct {
	// Field is a field

	Field int
}
    T is a type

The directive is gone (yay) but there's now a blank line. @ianlancetaylor explains it in #56592 (comment) and acknowledges that it is imperfect (but better than before).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions